Learn and Learn

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

Ruby – Find Inverse Hyperbolic Sine – asinh() Method with Examples

asinh() method can be used to find the inverse hyperbolic sine of the any given complex number in Ruby. asinh() method exists in CMath library of Ruby.

asinh() Method in Ruby

asinh() method exists in Standard CMath Library of Ruby. The purpose of this method is to provide perfect inverse hyperbolic sine for the given complex number.

 

Syntax of the asinh() Method in Ruby

Syntax of asinh() method is:

 

Parameter of asinh() Method in Ruby

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

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

 

Return Value of asinh()

asinh() method will return the inverse hyperbolic sine of the given numeric complex number.

 

Ruby – Get the asinh() of Given Numbers Example 1


Output

1.0612750619050357+0.6662394324925153i

 

Ruby – Get the asinh() of Given Numbers Example 2


Output

-1.0612750619050355+0.6662394324925153i

 

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


Output

 Error

 

Ruby – Handle Negative Values in asinh() Method Example 1


Output

-2.649196177806475-0.7803985799853912i

 

Ruby – Handle Negative Values in asinh() Method Example 2


Output

-2.312438341272753

 

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