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

Actionscript 2.0 language reference
Table of Contents

Advertisement

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

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 Player 5
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 : Number
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 Player 5
988
ActionScript classes
constructor is primarily used as a placeholder.
new Number
Number()
value
,
valueOf (Number.valueOf method)
.
Infinity
function that converts a parameter to a
is not provided.

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash 8

Table of Contents