# Ruby | Math atanh() function

The atanh() is an inbuilt function in Ruby returns the inverse hyperbolic tangent of an angle given in radians. It accepts values in the range [-1, +1] and returns in the range [-INFINITY, INFINITY].

Syntax: Math.atanh(value)

Parameters: The function accepts one mandatory parameter value which specifies the inverse hyperbolic angle in radian which lies in the range [-1, 1].

Return Value: It returns the inverse hyperbolic tangent of an angle given in radians

Example 1:

 `#Ruby program for atanh() function ` ` `  `#Assigning values ` `val1 = -1 val2 = 1 val3 = -0.5 val4 = 0.7 ` ` `  `#Prints the atanh() value ` `                                      ``puts` `Math.atanh(val1) ` `                                          ``puts` `Math.atanh(val2) ` `                                              ``puts` `Math.atanh(val3) ` `                                                  ``puts` `Math.atanh(val4) `

Output:

``` -Infinity
Infinity
-0.5493061443340548
0.8673005276940531
```

Example 2:

 `#Ruby program for atanh() function ` ` `  `#Assigning values ` `val1 = -0.7 val2 = 0.6 val3 = -0.56 val4 = 0.90 ` ` `  `#Prints the atanh() value ` `                                           ``puts` `Math.atanh(val1) ` `                                               ``puts` `Math.atanh(val2) ` `                                                   ``puts` `Math.atanh(val3) ` `                                                       ``puts` `Math.atanh(val4) `

Output:

```-0.8673005276940531
0.6931471805599453
-0.632833186665638
1.4722194895832204
```

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

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.