
Number Class
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
714
|
ActionScript Language Reference
See Also
The Number class, parseFloat(), parseInt(); “Explicit Type Conversion” in Chapter 3
Number Class
wrapper class for primitive numeric data
Flash 5
Constructor
new Number(value)
Arguments
value An expression to be resolved and, if necessary, converted to a numeric value,
then wrapped in a Number object.
Class Properties
The following properties are accessed directly as properties of the Number class, using
Number.propertyName. To access them you do not need to instantiate a new Number object
(i.e., there is no need for the constructor function). Some of these properties, such as
NaN,
don’t even require the
Number.propertyName notation. You can simply use NaN as shorthand
for
Number.NaN (details follow in entries for each property).
MAX_VALUE
The largest representable positive number in ActionScript.
MIN_VALUE
The smallest representable positive number in ActionScript.
NaN Special Not-a-Number value indicating invalid numeric data.
NEGATIVE_INFINITY
Any number more negative than
–MAX_VALUE.
POSITIVE_INFINITY
Any number larger than
MAX_VALUE.
Methods
toString() Convert a number to a string.
Description
The Number class has two purposes:
• It gives us access to built-in properties that represent special numeric values—
MAX_VALUE,
MIN_VALUE, NaN, NEGATIVE_INFINITY ...