Number Constructor; Positive_Infinity; (Number.positive_Infinity Property) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

Number constructor

public Number(num:Object)
Creates a new Number object. The
A Number object is not the same as the
primitive value.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
- The numeric value of the Number object being created or a value to be
num:Object
converted to a number. The default value is 0 if
Example
The following code constructs new Number objects:
var n1:Number = new Number(3.4);
var n2:Number = new Number(-10);
See also
toString (Number.toString method)
POSITIVE_INFINITY (Number.POSITIVE_INFINITY
property)
public static POSITIVE_INFINITY :
Specifies the IEEE-754 value representing positive infinity. The value of this property is the
same as that of the constant
Positive infinity is a special numeric value that is returned when a mathematical operation or
function returns a value larger than can be represented.
Availability: ActionScript 1.0; Flash Lite 2.0
Example
This example compares the result of dividing the following values.
var posResult:Number = 1/0;
if (posResult == Number.POSITIVE_INFINITY) {
trace("posResult = "+posResult); // output: posResult = Infinity
}
var negResult:Number = -1/0;
if (negResult == Number.NEGATIVE_INFINITY) {
trace("negResult = "+negResult); // output: negResult = -Infinity
548
ActionScript classes
constructor is primarily used as a placeholder.
new Number
Number()
value
,
valueOf (Number.valueOf method)
Number
.
Infinity
function that converts a parameter to a
is not provided.

Advertisement

Table of Contents
loading

Table of Contents