JavaScript – Math


What is Math ?

It is the study of numbers, structures, and space for solving problems.

What is Math in Javascript ?

Math is a Javascript built-in object which has properties and methods for mathematical constants and functions.

Math object provides you properties and methods for solving problems.

Math is not a javascript constructor.

Both the properties and methods of Math object are static.

Why is Math Object used in javascript ?

Math object is used to perform mathematical tasks on numbers.

Math object is used to perform calculations allows us to implement new workflow ideas.

What are the properties of Math Object?

Javascript Math object contains a list of properties mentioned below.

Free online javascript course !!!

Click to Learn More about – Javascript online learning

1. E

This is Euler’s constant and the base of natural logarithms, approximately 2.718.

2. LN2


This is Natural logarithm of 2, approximately 0.693.

3. LN10

This is Natural logarithm of 10, approximately 2.302.

4. LOG2E

This is Base 2 logarithm of E, approximately 1.442.


5. LOG10E

This is Base 10 logarithm of E, approximately 0.434.

6. PI

This is Ratio of the circumference of a circle to its diameter, approximately 3.14159.

7. SQRT1_2

This is Square root of 1/2; equivalently, 1 over the square root of 2, approximately 0.707.

8. SQRT2

This is Square root of 2, approximately 1.414.

Javascript Math object contains a list of methods mentioned below.

SnoMethod / FunctionDescription
1abs()abs() method returns the absolute value of the given number.
2acos()acos() method returns the arccosine of the given number in radians.
3asin()asin() method returns the arcsine of the given number in radians.
4atan()atan() method returns the arc-tangent of the given number in radians.
5cbrt()cbrt() method returns the cube root of the given number.
6ceil()ceil() method returns a smallest integer value, greater than or equal to the given number.
7cos()cos() method returns the cosine of the given number.
8cosh()cosh() method returns the hyperbolic cosine of the given number.
9exp()exp() method returns the exponential form of the given number.
10floor()floor() method returns largest integer value, lower than or equal to the given number.
11hypot()hypot() method returns square root of sum of the squares of given numbers.
12log()log() method returns natural logarithm of a number.
13max()max() method returns maximum value of the given numbers.
14min()min() method returns minimum value of the given numbers.
15pow()pow() method returns value of base to the power of exponent.
16random()random() method returns random number between 0 (inclusive) and 1 (exclusive).
17round()round() method returns closest integer value of the given number.
18sign()sign() method returns the sign of the given number
19sin()sin() method returns the sine of the given number.
20sinh()sinh() method returns the hyperbolic sine of the given number.
21sqrt()sqrt() method returns the square root of the given number
22tan()tan() method returns the tangent of the given number.
23tanh()tanh() method returns the hyperbolic tangent of the given number.
24trunc()trunc() method returns an integer part of the given number.