Mathematics (Definition)

Mathematical support.

The following table summarizes the support for mathematical computation in JavaScript:

abs()MathFunctionAbsolute value of a number
acos()MathFunctionInverse cosine
asin()MathFunctionInverse sine
atan()MathFunctionInverse tangent
atan2()MathFunctionInverse tangent of a slope
ceil()MathFunctionRound up
cos()MathFunctionCosine of an angle
EMathConstantExponential constant
exp()MathFunctionExponent function
floor()MathFunctionRound down
isFinite()GlobalFunctionTest for infinity
isNaN()GlobalFunctionTest for Not-a-Number
LN10MathConstantNatural log of 10
LN2MathConstantNatural log of 2
log()MathFunctionNatural log of a number
LOG10EMathConstantLog to the base 10 of e
LOG2EMathConstantLog to the base 2 of e
max()MathFunctionMaximum of two values
MAX_VALUENumberConstantMaximum numeric value
min()MathFunctionMinimum of two values
MIN_VALUENumberConstantMinimum numeric value
NaNNumberConstantNot a number
NEGATIVE_INFINITYNumberConstantNegative infinity
parseFloat()GlobalFunctionFloating point parser
parseInt()GlobalFunctionInteger parser
PIMathConstantThe value of PI
POSITIVE_INFINITYNumberConstantPositive infinity
pow()MathFunctionA value rased to the power of another
random()MathFunctionA random value
round()MathFunctionTruncating round
sin()MathFunctionSine of an angle
sqrt()MathFunctionSquare root
SQRT1_2MathConstantSquare toot of one half
SQRT2MathConstantSquare root of two
tan()MathFunctionTangent of an angle

You should avoid the use of any of these function names as identifiers unless you are intentionally overriding their behavior by adding function properties (methods) to a prototype.

See also:Arithmetic operator, Error, Integer arithmetic, Integer-value-remainder, Operator, Power function, Range error, Trigonometric function