Math.round、Math.floor、Math.ceil 区别时间:2023-03-09 21:38:22 1、Math.round() 按照四舍五入的方式返回值 例如:Math.round(9.5)=10 Math.round(9.4)=9 2、Math.floor()返回最小整数 例如:Math.floor(9.5)=9 Math.floor(9.2)=9 3、Math.ceil()返回最大整数 例如: Math.ceil(9.1)=10 Math.ceil(9.5)=10