Math

Moduleejs
Definition class Math
InheritanceMath inherit Object
StabilityEvolving.

The Math class provides a set of static methods for performing common arithmetic, exponential and trigonometric functions.

It also provides commonly used constants such as PI. See also the Number class. Depending on the method and the supplied argument, return values may be real numbers, NaN (not a number) or positive or negative infinity.


Properties

QualifiersPropertyTypeDescription
public static const ENumberBase of natural logarithms (Euler's number).
public static const LN10NumberNatural log of 10.
public static const LN2NumberNatural log of 2.
public static const LOG10ENumberBase 10 log of e.
public static const LOG2ENumberBase 2 log of e.
public static const PINumberThe ratio of the circumference to the diameter of a circle.
public static const SQRT1_2NumberReciprocal of the square root of 2.
public static const SQRT2NumberSquare root of 2.

Math Methods

QualifiersMethod
public static abs(value: Number): Number
 Returns the absolute value of a number (which is equal to its magnitude).
public static acos(angle: Number): Number
 Calculates the arc cosine of an angle (in radians).
public static asin(oper: Number): Number
 Calculates the arc sine of an angle (in radians).
public static atan(oper: Number): Number
 Calculates the arc tangent of an angle (in radians).
public static atan2(y: Number, x: Number): Number
 Calculates the arc tangent of the quotient of its arguments.
public static ceil(oper: Number): Number
 Return the smallest integer greater then this number.
public static cos(angle: Number): Number
 Calculates the cosine of an angle (in radians).
public static exp(power: Number): Number
 Calculate E to the power of the argument.
public static floor(oper: Number): Number
 Returns the largest integer smaller then the argument.
public static log(oper: Number): Number
 Calculates the natural log (ln) of a number.
public static log10(oper: Number): Number
 Calculates the log (base 10) of a number.
public static max(x: Number, y: Number): Number
 Returns the greater of the number or the argument.
public static min(x: Number, y: Number): Number
 Returns the lessor of the number or the argument.
public static pow(num: Number, pow: Number): Number
 Returns a number which is equal to this number raised to the power of the argument.
public static random(): Number
 Generates a random number (a Number) inclusively between 0.0 and 1.0.
public static round(num: Number): Number
 Round this number down to the closes integral value.
public static sin(angle: Number): Number
 Calculates the sine of an angle (in radians).
public static sqrt(oper: Number): Number
 Calculates the square root of a number.
public static tan(angle: Number): Number
 Calculates the tangent of an angle (in radians).

Method Detail

static public abs(value: Number): Number

Returns the absolute value of a number (which is equal to its magnitude).

Parameters
value: Number Number value to examine.
Returns
The absolute value.

static public acos(angle: Number): Number

Calculates the arc cosine of an angle (in radians).

Parameters
angle: Number In radians.
Returns
The arc cosine of the argument.

static public asin(oper: Number): Number

Calculates the arc sine of an angle (in radians).

Parameters
oper: Number The operand.
Returns
The arc sine of the argument.

static public atan(oper: Number): Number

Calculates the arc tangent of an angle (in radians).

Parameters
oper: Number The operand.
Returns
The arc tanget of the argument.

static public atan2(y: Number, x: Number): Number

Calculates the arc tangent of the quotient of its arguments.

Parameters
x: Number The x operand.
y: Number The y operand.
Returns
The arc tanget of the argument.

static public ceil(oper: Number): Number

Return the smallest integer greater then this number.

Returns
The ceiling.

static public cos(angle: Number): Number

Calculates the cosine of an angle (in radians).

Parameters
angle: Number In radians.
Returns
The cosine of the argument.

static public exp(power: Number): Number

Calculate E to the power of the argument.


static public floor(oper: Number): Number

Returns the largest integer smaller then the argument.

Parameters
oper: Number The operand.
Returns
The floor.

static public log(oper: Number): Number

Calculates the natural log (ln) of a number.

Parameters
oper: Number The operand.
Returns
The natural log of the argument.

static public log10(oper: Number): Number

Calculates the log (base 10) of a number.

Parameters
oper: Number The operand.
Returns
The base 10 log of the argument.
Specified
ejscript-1.1

static public max(x: Number, y: Number): Number

Returns the greater of the number or the argument.

Parameters
x: Number First number to compare.
y: Number Second number to compare.
Returns
A number.

static public min(x: Number, y: Number): Number

Returns the lessor of the number or the argument.

Parameters
x: Number First number to compare.
y: Number Second number to compare.
Returns
A number.

static public pow(num: Number, pow: Number): Number

Returns a number which is equal to this number raised to the power of the argument.

Parameters
num: Number The number to raise to the power.
pow: Number The exponent to raise.
Returns
A number.

static public random(): Number

Generates a random number (a Number) inclusively between 0.0 and 1.0.

Returns
A random number.

static public round(num: Number): Number

Round this number down to the closes integral value.

Parameters
num: Number Number to round.
Returns
A rounded number.

static public sin(angle: Number): Number

Calculates the sine of an angle (in radians).

Parameters
angle: Number In radians.
Returns
The sine of the argument.

static public sqrt(oper: Number): Number

Calculates the square root of a number.

Parameters
oper: Number The operand.
Returns
The square root of the argument.

static public tan(angle: Number): Number

Calculates the tangent of an angle (in radians).

Parameters
angle: Number In radians.
Returns
The tangent of the argument.