Math.ceil()
Math.ceil() 静态方法始终向上舍入并返回大于或等于给定数字的最小整数。
¥The Math.ceil() static method always rounds up and returns the smallest integer greater than or equal to a given number.
Try it
语法
参数
返回值
¥Return value
大于或等于 x 的最小整数。它与 -Math.floor(-x) 的值相同。
¥The smallest integer greater than or equal to x. It's the same value as -Math.floor(-x).
描述
示例
使用 Math.ceil()
规范
| Specification |
|---|
| ECMAScript Language Specification # sec-math.ceil |
浏览器兼容性
BCD tables only load in the browser