Learn and Learn

Learn And Learn - great place for tutorials, references and how-to

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


Output

0.0800418818990673+1.5305608211621662i

 

Ruby atanh() Method Example 1


Output

-0.08004188189906739+1.5305608211621662i

 

Ruby atanh() Method Example 2


Output

0.0+0.0i

 

Ruby atanh() Method Example 3


Output

-0.10033534773107555+1.5707963267948966i

 

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


Output

Error

 

Loading...
LearnAndLearn.com © 2018 - All rights reserved