# Javascript Math

In JavaScript, Math is a built-in object. It has both properties and methods for mathematical functions and constants.

Math operates with the Number type, but never with BigInt.

Unlike other global objects, Math is not considered a constructor. The methods and properties of Math are fixed. You can call them by applying Math as an object without creating it.

So, you refer to constant pi as Math.PI. Hence, the sine function should be called Math.sin(x). Here, x is the argument of the method.

The syntax to call the methods and properties of Math is the following:

``````var pi_value = Math.PI;
var sin_value = Math.sin(30);``````

Properties of Math

Now let’s check out the list of math properties with their descriptions.

Math.LN2

The natural logarithm of 2: nearly 0.693.

Javascript math logarithm

Math.LN10

The natural logarithm of 10; nearly 2.303.

Javascript math logarithm

Math.LOG2E

E’s base 2 logarithm; nearly 1.443.

Javascript math logarithm

Math.LOG10E

E’s base 10 logarithm; nearly 0.434.

Javascript math logarithm

Math.PI

The circumference ratio of a circle to its diameter ,nearly 3.14159.

Javascript math pi

Math.SQRT1_2

½ square root ( or correspondingly 1/√2); nearly 0.707.

Javascript math square root

Math.SQRT2

The square root of 2; nearly 1.414.

Javascript math square root

The Methods of Math

Below you will find the list of the math methods and their descriptions;

Math.abs(number)

This method is targeted at returning the absolute value of a number.

Javascript math absolute value

Math.acos(number)

Returning the arccosine (in radians) of a number.

Javascript math arccosine

Math.acosh(number)

Returning the hyperbolic arccosine of a number.

Javascript math arccosine

Math.asin(number)

Returning the arcsine of a number.

Javascript math asine

Math.asinh(x)

Returning the hyperbolic arcsine of a number.

Javascript math asinh

Math.atan(x)

Returning the arctangent of a number.

Javascript math arctangens

Math.floor(x)

Returning the largest integer that is less than or equal to a number.

Javascript math floor

Math.pow(x, y)

Returns the exponent power base, which is xy.

Javascript math round

Math.round(x)

Returning a number’s value rounded to the nearest integer.

Javascript math round

Math.sin(x)

Returning a number’s sine.

Javascript math sin

Math.sqrt(x)

Returning the positive square root of a number.

Javascript math sqrt
 Math.E Euler’s constant as well as natural logarithms’ base; nearly 2.718. Math.atanh(x) Returning the hyperbolic arctangent of a number. Math.atan2(y, x) Returning the arctangent of its arguments’ quotient. Math.cbrt(x) Returning a number’s cube root. Math.ceil(x) Returning the smallest integer that is greater than or equal to a number. Math.clz32(x) Returning the number of leading a 32-bit integer zeros. Math.cos(x) Returning the cosine of a number. Math.cosh(x) Returning a number’s hyperbolic cosine. Math.exp(x) Returning Ex, where x is the argument, and E is Euler's constant (2.718…, the natural logarithm base). Math.expm1(x) Returning subtracting 1 from exp(x). Math.fround(x) Returning a number’s nearest single-precision float representation. Math.hypot([x[, y[, …]]]) Returning the square root of the sum of squares of its arguments. Math.imul(x, y) Returning a 32-bit integer multiplication result. Math.log(x) Returning a number’s natural logarithm (㏒e; also, ㏑). Math. (x) Returning the natural logarithm (㏒e; also ㏑) of 1 + x for a number. Math.log10(x) Returning a number’s base 10 logarithm. Math.log2(x) Returning a number’s base 2 logarithm. Math.max([x[, y[, …]]]) Returning the largest of zero or more numbers. Math.min([x[, y[, …]]]) Returning the smallest of zero or more numbers. Math.random() Returning a pseudo-random number between 0 and 1. Math.sign(x) Returning the x sign, indicating whether x is positive, negative, or zero. Math.sinh(x) Returning a number’s hyperbolic sine. Math.tan(x) Returning a number’s tangent. Math.tanh(x) Returning the hyperbolic tangent of a number. Math.toSource() Returning the string "Math". Math.trunc(x) Returning the integer part of the number x and removing each fractional digit.