5.4 for for循环之后发生了什么

时间:2017-07-07 11:51:35

标签: c# vb.net loops double

static void Main(string[] args)
    {
        for (double i = 4; i <= 6; i += 0.1)
        {
            Console.WriteLine(i);
        }
        Console.ReadLine();
    }

输出是:

4

4.1

4.2

4.3

4.4

4.5

4.6

4.7

4.8

4.9

5

5.1

5.2

5.3

5.4

5.49999999999999

5.59999999999999

5.69999999999999

5.79999999999999

5.89999999999999

5.99999999999999

0 个答案:

没有答案