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: This function accepts a single value parameter which is the number whose hyperbolic arc-tangent you want to know.



Returns: 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
  • Example 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
  • Example 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
  • Examplw 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
  • Example 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

Supported Browsers: The browsers supported by JavaScript Math.atanh( ) function are listed below:

  • Google Chrome 38.0
  • Internet Explorer 12.0
  • Firefox 25.0
  • Opera 25.0
  • Safari 8.0


My Personal Notes arrow_drop_up

Recommended Posts:



    Article Tags :

    Be the First to upvote.


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