Math.ceil

Returns the smallest integer greater than or equal to a number.

Method of Math
Static

Syntax

ceil( x )

Parameters

Parameter Description
x A number

Description

Because ceil is a static method of Math, you always use it as Math.ceil(), rather than as a method of a Math object you created.

Examples

The following function returns the ceil value of the variable x:

If you pass 45.95 to getCeil, it returns 46; if you pass -45.95, it returns -45.

See also

Math.floor

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.