Math.ceil( ) Method

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
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( )



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net