03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Example<br />

The following <strong>ActionScript</strong> displays the largest <strong>and</strong> smallest representable numbers to the<br />

Output panel.<br />

trace("Number.MIN_VALUE = "+Number.MIN_VALUE);<br />

trace("Number.MAX_VALUE = "+Number.MAX_VALUE);<br />

This code displays the following values:<br />

Number.MIN_VALUE = 4.94065645841247e-324<br />

Number.MAX_VALUE = 1.79769313486232e+308<br />

NaN (Number.NaN property)<br />

public static NaN : Number<br />

The IEEE-754 value representing Not A Number (NaN).<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 5<br />

See also<br />

isNaN function<br />

NEGATIVE_INFINITY<br />

(Number.NEGATIVE_INFINITY property)<br />

public static NEGATIVE_INFINITY : Number<br />

Specifies the IEEE-754 value representing negative infinity. The value of this property is the<br />

same as that of the constant -Infinity.<br />

Negative infinity is a special numeric value that is returned when a mathematical operation or<br />

function returns a negative value larger than can be represented.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 5<br />

Example<br />

This example compares the result of dividing the following values.<br />

var posResult:Number = 1/0;<br />

if (posResult == Number.POSITIVE_INFINITY) {<br />

trace("posResult = "+posResult); // output: posResult = Infinity<br />

}<br />

var negResult:Number = -1/0;<br />

if (negResult == Number.NEGATIVE_INFINITY) {<br />

trace("negResult = "+negResult); // output: negResult = -Infinity<br />

Number 1001

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!