--- title: Math Ceil localeTitle: 数学Ceil --- ## 数学Ceil `Math.ceil()`是Math标准对象的一种方法,它将给定数字向上舍入到下一个整数。请注意,对于负数,这意味着该数字将被“舍入为0”而不是更大的绝对值数(参见示例)。 ### 例子 ```javascript Math.ceil(0.1) // 1 Math.ceil(1.3) // 2 Math.ceil(-0.9) // -0 Math.ceil(-1.5) // -1 ``` ### 更多信息: * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil) * [W3Schools的](https://www.w3schools.com/jsref/jsref_ceil.asp) * [维基百科](https://en.wikipedia.org/wiki/Floor_and_ceiling_functions)