Link Search Menu Expand Document

Math.ceil methods

Explanation Find the value rounded up to the nearest whole number.
Returns the smallest integer that is equal to or greater than x
Call format var v = Math.ceil (x)
Return value Returns the value rounded up to the nearest whole number as an integer.
Arguments Number x Value rounded up to the nearest whole number
Exception None
Example of use
print (Math.ceil (0.9), "\ n");   / * 1 * /
print (Math.ceil (1.0), "\ n");   / * 1 * /
print (Math.ceil (1.1), "\ n");   / * 2 * /
 
print (Math.ceil (-0.9), "\ n"); / * 0 * /
print (Math.ceil (-1.0), "\ n"); / * -1 * /
print (Math.ceil (-1.1), "\ n"); / * -1 * /
Related item floor, round methods