freeCodeCamp/guide/english/javascript/standard-objects/math/math-ceil/index.md

687 B

title
Math Ceil

Math Ceil

The Math.ceil() is a method of the Math standard object that rounds a given number upwards to the next integer. Take note that for negative numbers this means that the number will get rounded "towards 0" instead of the number of greater absolute value (see examples).

Examples

Math.ceil(0.1)  //  1
Math.ceil(1.3)  //  2
Math.ceil(-0.9) // -0
Math.ceil(-1.5) // -1

More Information: