三个与取整有关的方法

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;

原文地址:https://www.cnblogs.com/zhouyideboke/p/14505142.html