Original Post
When I subtract a double from another, when the result should be zero it isn''t, ie:
/////// code ///
double A1 = 0.1;
double result = 0.7;
for( int i = 0; i < 7; i++ )
{
cout << "Result: " << result << endl;
result -= A1;
}
cout << "...Result: " << result << endl;
///// end of code ////////
A should be 0.00....
However, it displays this:
1.3878e-016
or something just as small, but still if I was working to 20 decimal places, it would screw things up.
Any suggestions please.
Craigjw123@aol.com