| Package | Top Level | 
| Class | public final class Math | 
| Inheritance | Math  Object | 
Use the methods and properties of this class to access and manipulate mathematical constants and functions.
 All the properties and methods of the Math class are static and must be called using the syntax 
 Math.method(parameter) or Math.constant. 
 In ActionScript, constants are defined with the maximum precision of double-precision IEEE-754 floating-point numbers.
Several Math class methods use the measure of an angle in radians as a parameter. You can use the following equation 
 to calculate radian values before calling the method and then provide the calculated value as the parameter, or you can 
 provide the entire right side of the equation (with the angle's measure in degrees in place of degrees) as 
 the radian parameter.
To calculate a radian value, use the following formula:
radians = degrees * Math.PI/180
To calculate degrees from radians, use the following formula:
degrees = radians * 180/Math.PI
The following is an example of passing the equation as a parameter to calculate the sine of a 45° angle:
Math.sin(45 * Math.PI/180) is the same as Math.sin(.7854)
Note: The Math functions acos, asin, atan, atan2, cos, exp, log, pow, sin, and sqrt may result in slightly different values depending on the algorithms used by the CPU or operating system. Flash Player calls on the CPU (or operating system if the CPU doesn't support floating point calculations) when performing the calculations for the listed functions, and results have shown slight variations depending upon the CPU or operating system in use.
| Method | Defined By | ||
|---|---|---|---|
| [static] 
  Computes and returns an absolute value for the number specified by the 
  parameter val. | Math | ||
| [static] 
  Computes and returns the arc cosine of the number specified in the 
  parameter val, in radians. | Math | ||
| [static] 
  Computes and returns the arc sine for the number specified in the 
  parameter val, in radians. | Math | ||
| [static] 
  Computes and returns the value, in radians, of the angle whose tangent is 
  specified in the parameter val. | Math | ||
| [static] 
  Computes and returns the angle of the point y/x in 
  radians, when measured counterclockwise from a circle's x axis 
  (where 0,0 represents the center of the circle). | Math | ||
| [static] 
  Returns the ceiling of the specified number or expression. | Math | ||
| [static] 
  Computes and returns the cosine of the specified angle in radians. | Math | ||
| [static] 
  Returns the value of the base of the natural logarithm (e), to the 
  power of the exponent specified in the parameter val. | Math | ||
| [static] 
  Returns the floor of the number or expression specified in the parameter 
  val. | Math | ||
|  | 
  Indicates whether an object has a specified property defined. | Object | |
|  | 
  Indicates whether an instance of the Object class is in the prototype chain of the object specified 
  as the parameter. | Object | |
| [static] 
  Returns the natural logarithm of the parameter val. | Math | ||
| [static] 
  Evaluates val1 and val2 (or more values) and returns the largest value. | Math | ||
| [static] 
  Evaluates val1 and val2 (or more values) and returns the smallest value. | Math | ||
| [static] 
  Computes and returns val1 to the power of val2. | Math | ||
|  | 
  Indicates whether the specified property exists and is enumerable. | Object | |
| [static] 
  Returns a pseudo-random number n, where 0 <= n < 1. | Math | ||
| [static] 
  Rounds the value of the parameter val up or down to the nearest
  integer and returns the value. | Math | ||
|  | 
     Sets the availability of a dynamic property for loop operations. | Object | |
| [static] 
  Computes and returns the sine of the specified angle in radians. | Math | ||
| [static] 
  Computes and returns the square root of the specified number. | Math | ||
| [static] 
  Computes and returns the tangent of the specified angle. | Math | ||
|  | 
  Returns the string representation of the specified object. | Object | |
|  | 
  Returns the primitive value of the specified object. | Object | |
| Constant | Defined By | ||
|---|---|---|---|
| E : Number = 2.71828182845905 [static] 
  A mathematical constant for the base of natural logarithms, expressed as e. | Math | ||
| LN10 : Number = 2.302585092994046 [static] 
  A mathematical constant for the natural logarithm of 10, expressed as loge10,
  with an approximate value of 2.302585092994046. | Math | ||
| LN2 : Number = 0.6931471805599453 [static] 
  A mathematical constant for the natural logarithm of 2, expressed as loge2,
  with an approximate value of 0.6931471805599453. | Math | ||
| LOG10E : Number = 0.4342944819032518 [static] 
  A mathematical constant for the base-10 logarithm of the constant e (Math.E),
  expressed as log10e, with an approximate value of 0.4342944819032518. | Math | ||
| LOG2E : Number = 1.442695040888963387 [static] 
  A mathematical constant for the base-2 logarithm of the constant e, expressed 
  as log2e, with an approximate value of 1.442695040888963387. | Math | ||
| PI : Number = 3.141592653589793 [static] 
  A mathematical constant for the ratio of the circumference of a circle to its diameter,
  expressed as pi, with a value of 3.141592653589793. | Math | ||
| SQRT1_2 : Number = 0.7071067811865476 [static]  
  A mathematical constant for the square root of one-half, with an approximate  
  value of 0.7071067811865476. | Math | ||
| SQRT2 : Number = 1.4142135623730951 [static] 
  A mathematical constant for the square root of 2, with an approximate 
  value of 1.4142135623730951. | Math | ||
| abs | () | method | 
public static function abs(val:Number):Number
  Computes and returns an absolute value for the number specified by the 
  parameter val.
    
Parameters
| val:Number— The number whose absolute value is returned. | 
| Number— The absolute value of the specified paramater. | 
| acos | () | method | 
public static function acos(val:Number):Number
  Computes and returns the arc cosine of the number specified in the 
  parameter val, in radians.
    
Parameters
| val:Number— A number from -1.0 to 1.0. | 
| Number— The arc cosine of the parameterval. | 
| asin | () | method | 
public static function asin(val:Number):Number
  Computes and returns the arc sine for the number specified in the 
  parameter val, in radians.
    
Parameters
| val:Number— A number from -1.0 to 1.0. | 
| Number— A number between negative pi divided by 2 and positive pi 
  divided by 2. | 
| atan | () | method | 
public static function atan(val:Number):Number
  Computes and returns the value, in radians, of the angle whose tangent is 
  specified in the parameter val. The return value is between
  negative pi divided by 2 and positive pi divided by 2.
    
Parameters
| val:Number— A number that represents the tangent of an angle. | 
| Number— A number between negative pi divided by 2 and positive 
  pi divided by 2. | 
| atan2 | () | method | 
public static function atan2(y:Number, x:Number):Number
  Computes and returns the angle of the point y/x in 
  radians, when measured counterclockwise from a circle's x axis 
  (where 0,0 represents the center of the circle). The return value is between 
  positive pi and negative pi. Note that the first parameter to atan2 is always the y coordinate.
    
Parameters
| y:Number— The y coordinate of the point. | |
| x:Number— The x coordinate of the point. | 
| Number— A number. | 
See also
| ceil | () | method | 
public static function ceil(val:Number):Number
Returns the ceiling of the specified number or expression. The ceiling of a number is the closest integer that is greater than or equal to the number.
Parameters
| val:Number— A number or expression. | 
| Number— An integer that is both closest to, and greater than or equal to, the parameterval. | 
See also
| cos | () | method | 
public static function cos(angleRadians:Number):Number
Computes and returns the cosine of the specified angle in radians. To calculate a radian, see the overview of the Math class.
Parameters
| angleRadians:Number— A number that represents an angle measured in radians. | 
| Number—  A number from -1.0 to 1.0. | 
See also
| exp | () | method | 
public static function exp(val:Number):Number
  Returns the value of the base of the natural logarithm (e), to the 
  power of the exponent specified in the parameter val. The 
  constant Math.E can provide the value of e.
    
Parameters
| val:Number— The exponent; a number or expression. | 
| Number— 
e to the power of the parameterval. | 
See also
| floor | () | method | 
public static function floor(val:Number):Number
  Returns the floor of the number or expression specified in the parameter 
  val. The floor is the closest integer that is less than or equal
  to the specified number or expression.
    
Parameters
| val:Number— A number or expression. | 
| Number— The integer that is both closest to, and less than or equal to, the parameterval. | 
| log | () | method | 
public static function log(val:Number):Number
  Returns the natural logarithm of the parameter val.
    
Parameters
| val:Number— A number or expression with a value greater than 0. | 
| Number—  The natural logarithm of parameterval. | 
| max | () | method | 
public static function max(val1:Number, val2:Number, ... rest):Number
  Evaluates val1 and val2 (or more values) and returns the largest value.
    
Parameters
| val1:Number— A number or expression. | |
| val2:Number— A number or expression. | |
| ... rest— A number or expression.Math.max()can accept multiple arguments. | 
| Number— The largest of the parametersval1andval2(or more values). | 
See also
| min | () | method | 
public static function min(val1:Number, val2:Number, ... rest):Number
  Evaluates val1 and val2 (or more values) and returns the smallest value.
    
Parameters
| val1:Number— A number or expression. | |
| val2:Number— A number or expression. | |
| ... rest— A number or expression.Math.min()can accept multiple arguments. | 
| Number— The smallest of the parametersval1andval2(or more values). | 
See also
| pow | () | method | 
public static function pow(val1:Number, val2:Number):Number
  Computes and returns val1 to the power of val2.
    
Parameters
| val1:Number— A number to be raised by the power of the parameterval2. | |
| val2:Number— A number specifying the power that the parameterval1is raised by. | 
| Number— The value ofval1raised to the power ofval2. | 
| random | () | method | 
public static function random():Number
Returns a pseudo-random number n, where 0 <= n < 1. The number returned is calculated in an undisclosed manner, and pseudo-random because the calculation inevitably contains some element of non-randomness.
Returns| Number— A pseudo-random number. | 
| round | () | method | 
public static function round(val:Number):Number
  Rounds the value of the parameter val up or down to the nearest
  integer and returns the value. If val is equidistant 
  from its two nearest integers (that is, if the number ends in .5), the value 
  is rounded up to the next higher integer.
    
Parameters
| val:Number— The number to round. | 
| Number— The parametervalrounded to the nearest whole number. | 
See also
| sin | () | method | 
public static function sin(angleRadians:Number):Number
Computes and returns the sine of the specified angle in radians. To calculate a radian, see the overview of the Math class.
Parameters
| angleRadians:Number— A number that represents an angle measured in radians. | 
| Number— A number; the sine of the specified angle (between -1.0 and 1.0). | 
See also
| sqrt | () | method | 
public static function sqrt(val:Number):Number
Computes and returns the square root of the specified number.
Parameters
| val:Number— A number or expression greater than or equal to 0. | 
| Number— If the parametervalis greater than or equal to zero, a number; otherwiseNaN(not a number). | 
| tan | () | method | 
public static function tan(angleRadians:Number):Number
Computes and returns the tangent of the specified angle. To calculate a radian, see the overview of the Math class.
Parameters
| angleRadians:Number— A number that represents an angle measured in radians. | 
| Number— The tangent of the parameterangleRadians. | 
See also
| E | Constant | 
public static const E:Number = 2.71828182845905
  A mathematical constant for the base of natural logarithms, expressed as e.
  The approximate value of e is 2.71828182845905.
    
| LN10 | Constant | 
public static const LN10:Number = 2.302585092994046
A mathematical constant for the natural logarithm of 10, expressed as log10, with an approximate value of 2.302585092994046.
| LN2 | Constant | 
public static const LN2:Number = 0.6931471805599453
A mathematical constant for the natural logarithm of 2, expressed as log2, with an approximate value of 0.6931471805599453.
| LOG10E | Constant | 
public static const LOG10E:Number = 0.4342944819032518
  A mathematical constant for the base-10 logarithm of the constant e (Math.E),
  expressed as loge, with an approximate value of 0.4342944819032518. 
  
The Math.log() method computes the natural logarithm of a number. Multiply the 
  result of Math.log() by Math.LOG10E to obtain the base-10 logarithm.
| LOG2E | Constant | 
public static const LOG2E:Number = 1.442695040888963387
A mathematical constant for the base-2 logarithm of the constant e, expressed as log2e, with an approximate value of 1.442695040888963387.
The Math.log method computes the natural logarithm of a number. Multiply the 
  result of Math.log() by Math.LOG2E to obtain the base-2 logarithm.
| PI | Constant | 
public static const PI:Number = 3.141592653589793
A mathematical constant for the ratio of the circumference of a circle to its diameter, expressed as pi, with a value of 3.141592653589793.
| SQRT1_2 | Constant | 
public static const SQRT1_2:Number = 0.7071067811865476
A mathematical constant for the square root of one-half, with an approximate value of 0.7071067811865476.
| SQRT2 | Constant | 
public static const SQRT2:Number = 1.4142135623730951
A mathematical constant for the square root of 2, with an approximate value of 1.4142135623730951.