为什么呢?这要从浮点数说起。我们的计算机用的是二进制。这样十进制里的0.5在二进制里就被表示成0.1。而十进制的0.1在二进制里则是0.0001100110011...无限循环小数。如果有这么一个程序:
for (i = 1; i != 1.5; i += 0.1)
{
?? 燾out<<i<<endl;
}
(i从1开始,每次加0.1。若i等于1.5则结束循环,否则输出i。)
其中有一条评论:
I tried to play like your play,but the stylish points
I could get is no more than "7999".
I cannot get "8000".
Don't you have such experience?
Do you have any idea about the difference between my play and yours?