Table of Contents

Math.ceil( ) Method Flash 5; can be used when exporting Flash 4 movies

round a number up to the next integer
Math.ceil(x)

Arguments

x

A number.

Returns

The next integer greater than or equal to x.

Description

The ceil( ) (i.e., ceiling) method converts a floating-point number to the first integer greater than or equal to x. It leaves integers unchanged.

Example

Math.ceil(1.00001);  // Returns 2
Math.ceil(5.5);      // Returns 6
Math.ceil(-5.5);     // Returns -5
Math.ceil(3);        // Returns 3

See Also

Math.floor( ), Math.round( )


Table of Contents