Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual page 63

Programming actionscript 3.0
Table of Contents

Advertisement

Null data type
The Null data type contains only one value,
type and all classes that define complex data types, including the Object class. None of the
other primitive data types, such as Boolean, Number, int and uint, contain the value
Flash Player will convert the value
assign
to variables of type Boolean, Number, int, or uint. You cannot use this data type
null
as a type annotation.
Number data type
In ActionScript 3.0, the Number data type can represent integers, unsigned integers, and
floating point numbers. However, to maximize performance, you should use the Number data
type only for integer values larger than the 32-bit
point numbers. To store a floating point number, include a decimal point in the number. If
you omit a decimal point, the number will be stored as an integer.
The Number data type uses the 64-bit double-precision format as specified by the IEEE
Standard for Binary Floating-Point Arithmetic (IEEE-754). This standard dictates how
floating point numbers are stored using the 64 available bits. One bit is used to designate
whether the number is positive or negative. Eleven bits are used for the exponent, which is
stored as base 2. The remaining 52 bits are used to store the significand (also called the
mantissa), which is the number that is raised to the power indicated by the exponent.
By using some of its bits to store an exponent, the Number data type can store floating point
numbers significantly larger than if it used all of its bits for the significand. For example, if the
Number data type used all 64 bits to store the significand, it could store a number as large as
64
2
. By using 11 bits to store an exponent, the Number data type can raise its significand to a
1023
power of 2
.
The maximum and minimum values that the Number type can represent are stored in static
properties of the Number class called
Number.MAX_VALUE == 1.79769313486231e+308
Number.MIN_VALUE == 4.940656458412467e-324
Although this range of numbers is enormous, the cost of this range is precision. The Number
data type uses 52 bits to store the significand, with the result that numbers that require more
than 52 bits to represent precisely, such as the fraction 1/3, are only approximations. If your
application requires absolute precision with decimal numbers, you need to use software that
implements decimal floating point arithmetic as opposed to binary floating point arithmetic.
. This is the default value for the String data
null
to the appropriate default value if you attempt to
null
and
int
Number.MAX_VALUE
types can store or for floating
uint
and
Number.MIN_VALUE
Data types
.
null
.
63

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents