07-11-2005 04:48 PM
07-12-2005 07:20 AM
Floating point representations are not, in general, exact and you must allow for some error in the representation. For an iterative loop such as you have, it might be better to use an integer control variable:
for (i=0;i<7;i++)
{
double x=1.0 + 0.1*i;
...
}
or alternatively, you must allow for some error in the representation:
for (x=1.0; x<1.75;x+=0.1)
{
}