本文介绍了困惑!!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看看下面的VB代码。第一个MsgBox显示数字2

而第二个是6.为什么?为什么2.5被四舍五入为2和5.5是

四舍五入为6 ??


Dim i As Integer = 5/2


MsgBox(i)


Dim j As Integer = 11/2

MsgBox(j)

Have a look at the follwoing VB-code. The first MsgBox shows the number 2
while the second one 6. WHY? How come 2.5 is rounded off to 2 and 5.5 is
rounded off to 6??

Dim i As Integer = 5 / 2

MsgBox(i)

Dim j As Integer = 11 / 2

MsgBox(j)

推荐答案








数学四舍五入(右词?)意味着转到下一个_even_数字。

-

Armin



Mathematical rounding (right words?) means round to the next _even_ number.
--
Armin


这篇关于困惑!!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 02:51