Here i face a problem that when i am reading a floating point values from a text file (ex: 123.123567) it is reading as 123.12345670000001 like this.
I declared variable as :
double a,b,c; for eg: a=111.567 and b=123.12345
fscanf("%lf",&a,&b);
c=a-b;
// and you will receive
//
//a=111.56699999999999
//b=123.12340000000001
//c=0.56699999999999307
//
//instead => a=111.567, b=123.12345, c=0.567;
But in visual c++ 6.0 it reads the value exactly same as in the file.
So,anyone please provide a solution for this.
With regards,
Krish