Open In App

JavaScript Math acosh() Method

The Javascript Math.acosh() function in Javascript is used to return the hyperbolic arc-cosine of a number. Math.acosh (x) = arcosh(x) = y ≧ 0 such that cosh (y)=x acosh() is a static method of Math, therefore it is always used as Math.acosh(), rather than as a method of a Math object created. 

Syntax:



Math.acosh(value)

Parameters: This function accepts a single parameter.

Returns: It returns the hyperbolic arc-cosine of the given number and if the parameter passed is less than 1, it returns NaN.



Example 1: When 1 is passed as a parameter. 




<script type="text/javascript">
    console.log("Output : " + Math.acosh(1));
</script>

Output:

Output : 0

Example 2: When 0 is passed as a parameter. 




<script type="text/javascript">
    console.log("Output : " + Math.acosh(0));
</script>

Output:

Output : NaN

Example 3: When a number less than 0 is passed as a parameter. 




<script type="text/javascript">
    console.log("Output : " + Math.acosh(-1));
</script>

Output:

Output : NaN

Example 4: When 2 is passed as a parameter. 




<script type="text/javascript">
    console.log("Output : " + Math.acosh(2));
</script>

Output:

Output : 1.3169578969248166

We have a complete list of Javascript Math Objects methods, to check those please go through this Javascript Math Object Complete reference article.

Supported Browsers:


Article Tags :