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

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

posted @ 2020-07-01 20:36  咔啡  阅读(167)  评论(0编辑  收藏  举报