谁能向我解释为什么这个程序:
for(float i = -1; i < 1; i += .1F)
Console.WriteLine(i);
输出这个:
-1
-0.9
-0.8
-0.6999999
-0.5999999
-0.4999999
-0.3999999
-0.2999999
-0.1999999
-0.99999993
7.450581E-08
0.1000001
0.2000001
0.3000001
0.4000001
0.5000001
0.6000001
0.7000001
0.8000001
0.9000002
舍入误差从何而来?