A built-in object that has properties and methods for mathematical constants and functions.
Unlike the other global objects,
Math is not a constructor. All properties and methods of
Math are static. You refer to the constant pi as
Math.PI and you call the sine function as
- Euler's constant and the base of natural logarithms, approximately 2.718.
- Natural logarithm of 2, approximately 0.693.
- Natural logarithm of 10, approximately 2.303.
- Base 2 logarithm of E, approximately 1.443.
- Base 10 logarithm of E, approximately 0.434.
- Ratio of the circumference of a circle to its diameter, approximately 3.14159.
- Square root of 1/2; equivalently, 1 over the square root of 2, approximately 0.707.
- Square root of 2, approximately 1.414.
- Returns the absolute value (modulus) of a number. Note: modulus (%) is also an arithmetic operator.
- Returns the arccosine of a number.
- Returns the arcsine of a number.
- Returns the arctangent of a number.
- Returns the arctangent of the quotient of its arguments.
- Returns the smallest integer greater than or equal to a number.
- Returns the cosine of a number.
- Returns Enumber, where number is the argument, and E is Euler's constant (2.718...), the base of the natural logarithm.
- Returns the largest integer less than or equal to a number.
- Returns the result of a 32-bit integer multiplication.
- Returns the natural logarithm (loge, also ln) of a number.
- Returns the largest of zero or more numbers.
- Returns the smallest of zero or more numbers.
- Returns base to the exponent power, that is, baseexponent.
- Returns a pseudo-random number between 0 and 1.
- Returns the value of a number rounded to the nearest integer.
- Returns the sine of a number.
- Returns the positive square root of a number.
- Returns the tangent of a number.
Returns the string