I am doing calculation by C# on Win7.
I got a double number precision problem.
double x = 3389774.583;
string ss = "x is " + x + " x square is " + x * x + " , 11490571723552.8 - x*x is " + (11490571723552.8 - x * x) + "\n";
Console.WriteLine(ss);
you may find the result is not 0 even tough 11490571723552.8 is the x*x.
I know it is the precision problem of display and calculation.
I can set up a threshold to make the result 0.
Are there other better ways ?
Thanks