Name

Math — NN 2 IE J1 ECMA 1

Synopsis

The Math object is used only in its static object form as a library of math constant values and (mostly trigonometric) operations. As a result, there is no constructor function. Invoking a Math object property or method adheres to the following syntax:

Math.propertyName
Math.method(param1[, param2])

Be sure to observe the uppercase “M” in the Math object in script statements. All expressions involving the Math object evaluate to or return a value.

Properties

E
LN10
LOG10E
SQRT1_2
SQRT2
LN2
LOG2E
PI

Methods

abs()
atan2()
floor()
pow()
sin()
acos()
ceil()
log()
random()
sqrt()
asin()
cos()
max()
round()
tan()
atan()
exp()
min()

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.