I have following simple code:
for (float i=0; i<1f; i+=0.1) {
System.out.println(i);
}
I have just got following results:
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.70000005
0.8000001
0.9000001
But I can’t understand why there is. Please, I hope you can tell me. Thank you.
From The Floating-Point Guide: