Math.round(11.5)等于多少?Math.round(-11.5)等于多少?
ceil的英文意义是天花板,该方法就表示向上取整,Math.ceil(11.3)的结果为12,Math.ceil(-11.6)的结果为-11;
floor的英文是地板,该方法就表示向下取整,Math.floor(11.6)的结果是11,Math.floor(-11.4)的结果-12;
round方法,他表示“四舍五入”,算法为Math.floor(x
转载
2017-12-26 20:32:34 ·
1311 阅读 ·
0 评论