can anyone help me why the results of two below calculations are different?
double a= 1e-14;
double b= 1e-7;
double val=0;
val+=b;
val-=(a/b);
which results something like -4.3.....e-24 for val.
double a= 1e-14;
double b= 1e-7;
double val=0;
val+=b;
double val2= a/b;
val-=val2;
which results 0 for val. Can anyone explain that to me?
I'm using math.h library with MinGW.