Ruby – Find Inverse Hyperbolic Tangent – atanh() Method with Examples

In Ruby, atanh() is a method in CMath class  of Ruby language. It is used to find the inverse hyperbolic tangent of any given complex number in Ruby programming language

atanh() Method in Ruby

atanh() method exists in Standard CMath Library of Ruby. The purpose of this method is to provide perfect inverse hyperbolic tangent of any given complex number.


Syntax of the atanh() Method in Ruby

Syntax of atanh() method is:


Parameter of atanh() Method in Ruby

Parameter Description
xAny valid complex number. This parameter is required.

Note: If the x parameter is not a complex number, atanh() method will return an error.


Return Value of atanh()

atanh() method will return the arc tangent of any given complex number.


Ruby – Get the atanh() of Given Numbers




Ruby atanh() Method Example 1




Ruby atanh() Method Example 2




Ruby atanh() Method Example 3




Ruby – Non-Complex Number in atanh() Method Produces Error