Math.abs() - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

Math.abs()

Availability
Flash Player 5. In Flash Player 4, the methods and properties of the Math class are emulated using
approximations and might not be as accurate as the non-emulated math functions that Flash
Player 5 supports.
Usage
Math.abs(x:Number) : Number
Parameters
A number.
x
Returns
A number.
Description
Method; computes and returns an absolute value for the number specified by the parameter
Example
The following example shows how
not affect the value of the
var num:Number = -12;
var numAbsolute:Number = Math.abs(num);
trace(num); // output: -12
trace(numAbsolute); // output: 12
Math.abs()
parameter (called
x
num
returns the absolute value of a number and does
in this example):
.
x
Math.abs()
421

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents