Math.ceil() (Function)

The value rounded up to the next higher integer value.

Availability:

ECMAScript edition - 2
JavaScript - 1.0
JScript - 1.0
Internet Explorer - 3.02
Netscape - 2.0
Netscape Enterprise Server version - 2.0
Opera - 3.0
Property/method value type:Number primitive
JavaScript syntax:-Math.ceil(aValue)
Argument list:aValueA meaningful numeric value

According to the ECMA standard, this function returns the smallest number value that is not less than the argument and is equal to a mathematical integer. If the argument is already an integer, the argument itself is returned.

Special boundary conditions that affect the results are:

ArgumentResult
+infinity+infinity
-1 < argument > 00
-infinity-infinity
00
NaNNaN

Note that if the value is negative, the magnitude decreases while it increases for positive numbers. The ceil of 25.4 is 26 whereas the ceil of -25.4 is -25.

The result is the input value rounded up to the next higher integer value.

Warnings:

See also:Integer, Integer arithmetic, Integer-value-remainder, Math object, Math.abs(), Math.floor(), Math.round(), Number(), Remainder (%), Remainder then assign (%=), Type conversion

Cross-references:

ECMA 262 edition 2 - section - 15.8.2.6

ECMA 262 edition 3 - section - 15.8.2.6