运行一下代码Private Sub Command1_Click()Dim n As Singlen = 0For s = 1 To 50n = n + 0.1Next sPrint nEnd Sub输出n的结果竟然是 4.999998 ,不是5才正确吗还有这个Private Sub Command1_Click()Dim s, x, y As Singlex = 0.1y = 0.1s = x + yPrint sEnd Sub输出的结果是.200000001490116 ,为什么后面会...?但是我把它改成Private Sub Command1_Click()Dim x, y, s As Singlex = 0.1y = 0.1s = x + yText1.Text = sEnd Sub就正常了。是什么原因??
添加回答
举报
0/150
提交
取消