## Math Object in JavaScript

In JavaScript Math object is used to perform mathematical tasks on numbers from (0-9). In this tutorial you will learn about Math Object.

There is a list of JavaScript Math methods with description.

Methods Description
abs() This mathed is used to returns the absolute value of the given number in JavaScript.
acos() This mathed is used to returns the arccosine of the given number in radians in JavaScript.
asin() This mathed is used to returns the arcsine of the given number in radians in JavaScript.
atan() This mathed is used to returns the arc-tangent of the given number in radians in JavaScript.
cbrt() This mathed is used to returns the cube root of the given number in JavaScript.
ceil() This mathed is used to returns a smallest integer value, greater than or equal to the given number in JavaScript.
cos() This mathed is used to returns the cosine of the given number in JavaScript.
cosh() This mathed is used to returns the hyperbolic cosine of the given number in JavaScript.
exp() This mathed is used to returns the exponential form of the given number in JavaScript.
floor() This mathed is used to returns largest integer value, lower than or equal to the given number in JavaScript.
hypot() This mathed is used to returns square root of sum of the squares of given numbers in JavaScript.
log() This mathed is used to returns natural logarithm of a number in JavaScript.
max() This mathed is used to returns maximum value of the given numbers in JavaScript.
min() This mathed is used to returns minimum value of the given numbers in JavaScript.
pow() This mathed is used to returns value of base to the power of exponent in JavaScript.
random() This mathed is used to returns random number between 0 (inclusive) and 1 (exclusive) in JavaScript.
round() This mathed is used to returns closest integer value of the given number in JavaScript.
sign() This mathed is used to returns the sign of the given number in JavaScript.
sin() This mathed is used to returns the sine of the given number in JavaScript.
sinh() This mathed is used to returns the hyperbolic sine of the given number in JavaScript.
sqrt() This mathed is used to returns the square root of the given number in JavaScript.
tan() This mathed is used to returns the tangent of the given number in JavaScript.
tanh() This mathed is used to returns the hyperbolic tangent of the given number in JavaScript.
trunc() This mathed is used to returns an integer part of the given number in JavaScript.

### Example of Math.sqrt(n)

In this example math.sqrt(n) method to display the square root of the given number.

````<``script` `type` `=` `"``text/javascript``"``>`
var a = Math.sqrt(16);
document.write("Value is: " + a);
`<``/script``>`
```

### Example of Math.random()

In this example math.random() method to display the random number between 0 to 1.

````<``script` `type` `=` `"``text/javascript``"``>`
document.write("Random value is: " + Math.random());
`<``/script``>`
```

### Example of Math.pow(m,n)

In this example math.pow(m,n) method to display the m to the power of n that is mn.

````<``script` `type` `=` `"``text/javascript``"``>`
document.write("4 to the power of 5 is: " + Math.pow(4,5));
`<``/script``>`
```

### Example of Math.ceil(n)

In this example math.ceil(n) method to display the largest integer for the given number. For example 4 for 3.7, 6 for 5.9 etc.

````<``script` `type` `=` `"``text/javascript``"``>`
document.write("Ceil of 2.6 is: " + Math.ceil(2.6));
`<``/script``>`
```

### Example of Math.abs(n)

In this example math.abs(n) method to display the absolute value for the given number. For example 4 for -4, 6.6 for -6.6 etc.

````<``script` `type` `=` `"``text/javascript``"``>`
document.write("Absolute value of -5 is: " + Math.abs(-5));
`<``/script``>`
```

The Best

### Comment here

If you have any query, if you want to know something about any of technical course related to computer science field, if you have any suggestion about relevant to uploaded content or if you anything wrong here (any mistake in content) than please contact us. Keep in mind, comment should be according to community guidelines.

#### Latest Posts    