Math.round(11.5) 等于多少?Math.round(-11.5)等于多少?

Math.round(11.5)的返回值是12Math.round(-11.5)的返回值是-11。四舍五入的原理是在参数上加0.5然后进行下取整。

猜你喜欢

转载自blog.csdn.net/W_Y_L_/article/details/83058558