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 infinite number read-only
Infinity

Description

A number that exceeds the maximum allowed numeric value in ActionScript is represented by the numeric constant Infinity (although incalculable numbers are represented by NaN). The largest value allowed in ActionScript is represented by Number.MAX_VALUE, which equates to 1.79769313486231e+308. Exceeding the largest allowed number in ActionScript is known as an overflow condition and is typically caused by a mathematical error.

Example

The result of a calculation that exceeds the largest allowed number is Infinity. For example:

Number.MAX_VALUE * 2;    // Yields Infinity

Infinity also results when dividing a positive number by zero:

1000 / 0;                // Yields Infinity

Usage

Infinity is shorthand for Number.POSITIVE_INFINITY.

See Also

-Infinity, isFinite( ), NaN, Number.POSITIVE_INFINITY; Section 4.3.3



    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