|
 |
The Math prototype object provides access to commonly used mathematical constants and functions.
Prototype Properties
E |
2.7182818284590452354; read only. |
LN10 |
2.302585092994046; read only. |
LN2 |
0.6931471805599453; read only. |
LOG2E |
1.4426950408889634; read only. |
LOG10E |
0.4342944819032518; read only. |
PI |
3.14159265358979323846; read only. |
SQRT1_2 |
0.7071067811865476; read only. |
SQRT2 |
1.4142135623730951; read only. |
|
Prototype Methods
abs |
Returns the absolute value of its argument. |
acos |
Returns an approximation to the arc cosine of the argument. The argument is expressed in radians. |
asin |
Returns an approximation to the arc sine of the argument. The argument is expressed in radians. |
atan |
Returns an approximation to the arc tangent of the argument. The argument is expressed in radians. |
atan2 |
Returns an approximation to the arc tangent of (x/y),
where the signs of the arguments are used
to determine the quadrant of the result. The
arguments are expressed in radians. |
ceil |
Returns the smallest integer value that is not less than the argument. If the argument is already an integer, the result is the argument itself. |
cos |
Returns an approximation to the cosine of the argument. The argument is expressed in radians. |
exp |
Returns an approximation to the exponential function of the argument (e raised to the power of the argument, where e is the base of the natural logarithms). |
floor |
Returns the greatest integer value that is not greater than the argument. If the argument is already an integer, the result is the argument itself. |
log |
Returns an approximation to natural logarithm of the argument. |
max |
Returns the larger of the two arguments. |
min |
Returns the smaller of the two arguments. |
pow |
Returns an approximation to the result of raising x to the power of y. |
random |
Returns a pseudo-random decimal value in the range of zero to one. The random number generator is seeded with the current system time. |
round |
Returns the integer value that is closest to the argument. |
sin |
Returns an approximation to the sine of the argument. The argument is expressed in radians. |
sqrt |
Returns an approximation to the square root of the argument. |
tan |
Returns an approximation to the tangent of the argument. The argument is expressed in radians. |
|
|