floor向下取整,返回不大于的最大整数 Math.floor(1.4)=1.0ceil向上取整,返回不小于的最小整数 Math.ceil(1.4)=2.0round 四舍五入,将原来的数字加入0.5后再向下取整Math.round(-1.4)=-1 Math.round(-1.5)=-1 Math.round(-1.6)=-2
Math中的floor,round和ceil方法总结
原文:http://www.cnblogs.com/zhaobao1830/p/6340495.html