math.floor
Math.floor
floor -- 原意 地板。
数学函数,求一个浮点数的地板,就是求一个最接近它的整数,它的值小于或等于这个浮点数。
例如:
Math.floor(0.60) -- 0
Math.floor(0.40) -- 0
Math.floor(5) -- 5
Math.floor(5.1) -- 5
Math.floor(-5.1) -- -6
Math.floor(-5.9) -- -6
posted on 2015-08-24 20:56 public_void_digua 阅读(158) 评论(0) 编辑 收藏 举报