Open In App

JavaScript Math acosh() Method

Improve
Improve
Like Article
Like
Save
Share
Report

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.

  • value: Which is the number whose hyperbolic arc-cosine you want to know. 

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. 

Javascript




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


Output:

Output : 0

Example 2: When 0 is passed as a parameter. 

Javascript




<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. 

Javascript




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


Output:

Output : NaN

Example 4: When 2 is passed as a parameter. 

Javascript




<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:

  • Google Chrome 1 and above
  • Internet Explorer 3 and above
  • Firefox 1 and above
  • Opera 3 and above
  • Safari 1 and above


Last Updated : 26 May, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads