Built in object in JavaScript

Math (Static properties)

Math.PI: The constant PI value.

Math.E: provides the Euler’s constant.

Math.LN2: provides the natural logarithm of 2.

Math.LN10: provides the natural logarithm of 10

Math.LOG2E: provides the base 10 logarithm of e

Math.LOG10E: The base 10 logarithm of e

Math.SQRT1_2: The square root of one-half

Math.SQRT2: The square root of 2

Math (Methods)

Math.abs(): Returns the absolute value of a number

Math.acos(): Returns the arc cosine of a number

Math.asin(): Returns the arc sine of a number

Math.atan(): Returns the arc tangent of a number

Math.ceil(): Returns the least integer greater than or equal to a number

Math.cos(): Returns the cosine of a number

Math.exp(): Returns e (Euler’s constant) to the power of a number

Math.floor(): Returns the greatest integer less than or equal to its argument

Math.log(); Returns the natural logarithm (base e) of a number

Math.max(): Returns the greater of two values

Math.min(): Returns the lesser of two values

Math.pow(): Returns the value of a number times a specified power

Math.random(): Returns a random number (X-platforms only)

Math.round(): Returns a number rounded to the nearest whole value

Math.sin(): Returns the sine of a number

Math.sqrt(): Returns the square root of a number

Math.tan(): Returns the tangent of a number

--

--