-Infinity Global Property

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
-Infinity Global Property Flash 5

a constant representing an infinitely negative number read-only
-Infinity

Description

A number that exceeds the allowed negative numeric value in ActionScript is represented by the numeric constant -Infinity (although incalculable numbers are represented by NaN). The smallest negative value (the one with the largest absolute value) allowed in ActionScript is -Number.MAX_VALUE, which is equivalent to -1.79769313486231e+308. Exceeding the most-negative number representable in ActionScript is known as an underflow condition and is typically caused by a mathematical error.

Example

The result of a calculation that is smaller than (i.e., more negative than) the smallest allowed negative number is -Infinity. For example:

-Number.MAX_VALUE * 2;    // Yields -Infinity

-Infinity also results when dividing a negative number by zero:

-1000 / 0;                // Yields -Infinity

Usage

-Infinity is normally used in place of its more verbose equivalent Number.NEGATIVE_INFINITY.

See Also

-Infinity, isFinite( ), NaN, Number.MAX_VALUE, Number.NEGATIVE_INFINITY; "Special Values of the Number Datatype," in Chapter 4



    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