0
点赞
收藏
分享

微信扫一扫

三个与取整有关的方法

_阿瑶 2022-07-13 阅读 70

Math.ceil():表示向上取整;Math.ceil(11.3)=12;Math.ceil(-11.3)=-12。

Math.floor():表示向下取整;Math.floor(11.6)=11;Math.floor(-11.6)=-12。

Math.round():表示四舍五入;Math.round(11.5)=12;Math.round(-11.5)=-11;



举报

相关推荐

0 条评论