js中Math.floor(),Math.round(),Math.ceil()
1、Math.floor() ,Math.round()方法执行的是取整计算,它们得到的是与之最接近的整数当参数没有的时候,返回你NaNMath.floor()NaNMath.round()NaN

2、我们再使用Math.floor()传入其它参数看看,如下所示。可以看出返回的都是比它小的,最接近它的整数Math.floor(2.9)2Math.floor(-2.9)-3Math.floor(-0.5)-1Math.floor(-0.9)-1Math.floor(0.9)0Math.floor(1.9)1

4、ceil() 方法是向上取整计算,它返回的是大于或等于参数的整数数据同样Math.ceil()没传入参数也是返回NaNMath.ceil()NaN
