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
static const ENumberBase of natural logarithms (Euler's number).
static const LN10NumberNatural log of 10.
static const LN2NumberNatural log of 2.
static const LOG10ENumberBase 10 log of e.
static const LOG2ENumberBase 2 log of e.
static const PINumberThe ratio of the circumference to the diameter of a circle.
static const SQRT1_2NumberReciprocal of the square root of 2.
static const SQRT2NumberSquare root of 2.

Math Class Methods

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

Math Instance Methods

(No own instance methods defined)

QualifiersMethod

Method Detail

static abs(value: Number): Number
Description
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 acos(angle: Number): Number
Description
Calculates the arc cosine of an angle (in radians).
Parameters
angle: Number In radians.
Returns
The arc cosine of the argument.

static asin(oper: Number): Number
Description
Calculates the arc sine of an angle (in radians).
Parameters
oper: Number The operand.
Returns
The arc sine of the argument.

static atan(oper: Number): Number
Description
Calculates the arc tangent of an angle (in radians).
Parameters
oper: Number The operand.
Returns
The arc tanget of the argument.

static atan2(y: Number, x: Number): Number
Description
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 H.

static ceil(oper: Number): Number
Description
Return the smallest integer greater then this number.
Returns
The ceiling.

static cos(angle: Number): Number
Description
Calculates the cosine of an angle (in radians).
Parameters
angle: Number In radians.
Returns
The cosine of the argument.

static exp(power: Number): Number
Description
Calculate E to the power of the argument.

static floor(oper: Number): Number
Description
Returns the largest integer smaller then the argument.
Parameters
oper: Number The operand.
Returns
The floor.

static log(oper: Number): Number
Description
Calculates the natural log (ln) of a number.
Parameters
oper: Number The operand.
Returns
The natural log of the argument.

static log10(oper: Number): Number
Description
Calculates the log (base 10) of a number.
Parameters
oper: Number The operand.
Returns
The base 10 log of the argument.
Specified
ejscript-2.7

static max(x: Number, y: Number): Number
Description
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 min(x: Number, y: Number): Number
Description
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 pow(num: Number, pow: Number): Number
Description
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 random(): Number
Description
Generates a random number (a Number) inclusively between 0.0 and 1.0.
Returns
A random number.

static round(num: Number): Number
Description
Round this number down to the closes integral value.
Parameters
num: Number Number to round.
Returns
A rounded number.

static sin(angle: Number): Number
Description
Calculates the sine of an angle (in radians).
Parameters
angle: Number In radians.
Returns
The sine of the argument.

static sqrt(oper: Number): Number
Description
Calculates the square root of a number.
Parameters
oper: Number The operand.
Returns
The square root of the argument.

static tan(angle: Number): Number
Description
Calculates the tangent of an angle (in radians).
Parameters
angle: Number In radians.
Returns
The tangent of the argument.