JavaScript Math.atanh( )

The Math.atanh() function in JavaScript is used to return the hyperbolic arctangent of a number.
Math.atanh (x) = arctanh(x) = y such that tanh (y) = x
atanh() is a static method of Math, therefore it is always used as Math.atanh(), rather than as a method of a Math object created.

Syntax:

Math.atanh(value)

Parameters Used:
1. value: It is the number whose hyperbolic arc-tangent you want to know.

Return Value:
It returns the hyperbolic arc-tangent of the given number.

Examples:



Input : Math.atanh(1)
Output : Infinity

Input : Math.atanh(0)
Output : 0

Input : Math.atanh(2)
Output : NaN

Input : Math.atanh(0.5)
Output : 0.5493061443340548

  1. When 1 is passed as a parameter.
    filter_none

    edit
    close

    play_arrow

    link
    brightness_4
    code

    <script type="text/javascript">
       document.write("OUTPUT : " + Math.atanh(1));
    </script>

    chevron_right

    
    

    OUTPUT:

    OUTPUT : Infinity
  2. When 0 is passed as a parameter.
    filter_none

    edit
    close

    play_arrow

    link
    brightness_4
    code

    <script type="text/javascript">
       document.write("OUTPUT : " + Math.atanh(0));
    </script>

    chevron_right

    
    

    OUTPUT:

    OUTPUT : 0
  3. When 2 is passed as a parameter.
    filter_none

    edit
    close

    play_arrow

    link
    brightness_4
    code

    <script type="text/javascript">
       document.write("OUTPUT : " + Math.atanh(2));
    </script>

    chevron_right

    
    

    OUTPUT:

    OUTPUT : NaN
  4. When 0.5 is passed as a parameter.
    filter_none

    edit
    close

    play_arrow

    link
    brightness_4
    code

    <script type="text/javascript">
       document.write("OUTPUT : " + Math.atanh(0.5));
    </script>

    chevron_right

    
    

    OUTPUT:

    OUTPUT : 0.5493061443340548


My Personal Notes arrow_drop_up

I am a technology enthusiast who has a keen interest in programming I am pursuing Engineering in Computer Science from GEU, Dehradun I like to unwind by watching movies and English sitcomsI have a keen interest in music

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.