+ 1
Float in loop
3 Answers
+ 3
devanille really float:-)
+ 2
Floating-point cannot represents fractional value perfectly. It can represents 1.0 perfectly, but if that 1.0 is the result of multiple additions, it may not perfect.
If you try to change the print in that function to
printf("d = %.20f\n", d);
you'll see at some point that the value is slightly different than it should be
0
Agent_I thanx for hint as "%.20f".