ceil Function

Top  Previous  Next

Rounds a number upward to it's nearest integer.

Syntax

Math.ceil(number)

Arguments

numberA number.        

Return Value

A number which represents the nearest integer when rounding upwards.

Examples

Math.ceil(0.1);          // Returns 1

Math.ceil(-0.1);         // Returns 0

Math.ceil(-8.9);         // Returns -8

Math.ceil(-8.1);         // Returns -8

See also

Math.floor