Am trying to create simple while loop until my variable will be 0. So am created a
do
{
x = x + 0.001;
cout << x0 << endl;
} while (SOME_CALCULATION != 0);
Everything works great until my loop reach 0 then i getting 7.63278e-017 instead of 0.
Loop example:
result: -0.003
result: -0.002
result: -0.001
result: 7.63278e-017
result: 0.001
result: 0.002
result: 0.003