Math.floor(x)
x的底限:小于或等于x的最大整数。
语法 (Syntax)
Math.floor( x ) ;
参数 (Parameter)
- X - 代表一个数字
例子 (Example)
console.log("---Math.floor()---")
console.log("Math.floor(2.8) : "+Math.floor(2.8))
console.log("Math.floor(-3.2) : "+Math.floor(-3.2))
输出 (Output)
---Math.floor()---
Math.floor(2.8) : 2
Math.floor(-3.2) : -4