rint(x):x取整为它最接近的整数,如果x与两个整数的距离相等,则返回其中为偶数的那一个。
round(x):返回Math.floor(x+0.5),即“四舍五入”值。
例:
rint(3.5) = 4
rint(4.5) = 4
round(4.5) = 4
round(4.4) = 4
rint(x):x取整为它最接近的整数,如果x与两个整数的距离相等,则返回其中为偶数的那一个。
round(x):返回Math.floor(x+0.5),即“四舍五入”值。
例:
rint(3.5) = 4
rint(4.5) = 4
round(4.5) = 4
round(4.4) = 4