I want to understand why this for
doesn't stop its execution to 10. See the code:
#include <stdio.h>
int main()
{
float i;
for (i = 0.0; i <= 10; i += 0.01)
printf("Iteration %g\n", i);
return 0;
}
The latest iterations are:
Iteration 9.96013
Iteration 9.97013
Iteration 9.98013
Iteration 9.99013
Why this behaviour ?