Skip to main content

ceil

Function ceil 

Source
pub fn ceil(x: number) -> number
Expand description

Rounds a number up to the nearest integer.

§Parameters

  • x: a number.

§Return value

The smallest integral value greater than or equal to x, as an integer. Raises an error if the result does not fit in an integer.

§Examples

print(math.ceil(4.2))    --> 5
print(math.ceil(-4.2))   --> -4
print(math.ceil(7))      --> 7

§See also

floor, modf