while ( 1.0-D != 0.0 ) {
cout << D << endl;
D=D+0.1;
}
return 0;
}
On executing, while loop becomes an infinite loop. The answer that i got is, there is the problem with precision. But if i use this condition in if statement that it returns correctly true or false.
Very good article. Personally I think we need an article that suggests to solve problems in the integer domain if at all possible and resort to floating point only if absolutely unavoidable.
Personally I think we need an article that suggests to solve problems in the integer domain if at all possible
I doubt that it would be of much use - I wonder why I wrote that other article in the first place. Those who could use it don't seem to be willing to read it, as seen from the post above...