-
Math.round()方法: 表示的是“四舍五入”计算。
Math.round(1.5) = 2
Math.round(-1.5) = -1 -
Math.floor()方法: 表示的是“向下取整”计算。
Math.floor(1.7) = 1.0
Math.floor(-1.2) = -2.0 -
Math.ceil()方法: 表示的是“向上取整”计算。
Math.ceil(1.3) = 2.0
Math.ceil(-1.7) = -1.0
Math.round()方法: 表示的是“四舍五入”计算。
Math.round(1.5) = 2
Math.round(-1.5) = -1
Math.floor()方法: 表示的是“向下取整”计算。
Math.floor(1.7) = 1.0
Math.floor(-1.2) = -2.0
Math.ceil()方法: 表示的是“向上取整”计算。
Math.ceil(1.3) = 2.0
Math.ceil(-1.7) = -1.0
Copyright © 2019- huatuo9.cn 版权所有 赣ICP备2023008801号-1
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务