Tutorialspoint.dev

Math.acosh( ) In JavaScript

The 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 Used:
1. value:It is the number whose hyperbolic arc-cosine you want to know.

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

Examples:



Input : Math.acosh(1)
Output : 0

Input :Math.acosh(0)
Output :NaN

Input :Math.acosh(-1)
Output :NaN

Input :Math.acosh(2)
Output : 1.3169578969248166

  1. When 1 is passed as a parameter.
    <script type="text/javascript">
       document.write("OUTPUT : " + Math.acosh(1));
    </script>

    OUTPUT:

    OUTPUT : 0
  2. When 0 is passed as a parameter.
    <script type="text/javascript">
       document.write("OUTPUT : " + Math.acosh(0));
    </script>

    OUTPUT:

    OUTPUT : NaN
  3. When a number less than 0 is passed as a parameter.
    <script type="text/javascript">
       document.write("OUTPUT : " + Math.acosh(-1));
    </script>

    OUTPUT:

    OUTPUT : NaN
  4. When 2 is passed as a parameter.
    <script type="text/javascript">
       document.write("OUTPUT : " + Math.acosh(2));
    </script>

    OUTPUT:

    OUTPUT : 1.3169578969248166


This article is attributed to GeeksforGeeks.org

leave a comment

code

0 Comments

load comments

Subscribe to Our Newsletter