Skip to content

Instantly share code, notes, and snippets.

@asd227695
asd227695 / DEC_TO_ALL.CPP
Last active January 17, 2019 10:58
Conversion of floating point decimal into other base system
#include<iostream>
using namespace std;
void convert(float num,float base)
{
int a[30];
int num1,k;
num1=num;
num=num-num1;
int t;
a[0]=num1%(int)base;
@asd227695
asd227695 / FINAL_BISECTION_METHOD.CPP
Created January 9, 2019 19:07
Bisection Method of Numerical Engineering using 3 stopping criterion. This program is for the equation (x-2)^2-log(x)=0. You can change it by changing the return statement in the function name "func".
#include<iostream>
#include<math.h>
#define e 2.718281828
#define pie 3.141592654
using namespace std;
double r;
int m;
float num;
double ea;
int flag;
@asd227695
asd227695 / FLOAT_ALL_TO_DEC.CPP
Last active January 17, 2019 10:45
Conversion of other base system to decimal(floating and normal).
#include<iostream>
#include<string.h>
#include<math.h>
#include<cctype>
using namespace std;
int bd[30],ad[30],l_bd,l_ad,flag;
void change(char a[30],int n,int base)
{
int i=0,j=0;
while(a[i]!='.'&&i<n)