Math 的相关方法
2018-07-10 本文已影响5人
贝灬小晖
1.Math.floor
求一个浮点数的地板,就是求一个最接近它的整数,它的值小于或等于这个浮点数。
Math.floor(0.60) -- 0
Math.floor(0.60) -- 0
Math.floor(5) -- 5
Math.floor(5.1) -- 5
Math.floor(-5.1) -- -6
Math.floor(-5.9) -- -6
1.Math.floor
求一个浮点数的地板,就是求一个最接近它的整数,它的值小于或等于这个浮点数。
Math.floor(0.60) -- 0
Math.floor(0.60) -- 0
Math.floor(5) -- 5
Math.floor(5.1) -- 5
Math.floor(-5.1) -- -6
Math.floor(-5.9) -- -6