Name
Infinity Global Property — a constant representing an infinite number
Availability
Flash 5
Synopsis
Infinity
Access
Read-only
Description
Any number in ActionScript that exceeds the maximum allowed numeric
range is represented by the numeric constant
Infinity
. The largest value allowed in
ActionScript is represented by Number.MAX_VALUE
(1.7976931348623157e+308).
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
,
Number.POSITIVE_INFINITY
; Section 4.3.3 in Chapter 4
Get ActionScript: The Definitive Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.