Learn and Learn

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

Ruby – Find Hyperbolic Sine – sinh() Method – Examples & Explanation

sinh() method can be used to find the hyperbolic sine of the any given complex number in Ruby language where number should be given in radians. sinh() method exists in CMath library of Ruby programming language.

sinh() Method in Ruby

sinh() method exists in Standard CMath Library of Ruby. The purpose of this method is to provide perfect hyperbolic sine of any given complex number where this number is given in radians.

Syntax of the sinh() Method in Ruby

Syntax of sinh() method is:

 

Parameters of sinh() Method in Ruby

Parameter Description
x Any valid complex number. This parameter is required.

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

 

Return Value of sinh()

sinh() method will return the hyperbolic sine of the any given complex number where this number is given in radians.

 

How to get the sinh() of the Given Numbers in Ruby?


Output

21.048644880883543-71.16172106192103i

 

Ruby sinh() Function


Output

-21.048644880883543-71.16172106192103i

 

Ruby Non-Complex Values Produces Error in sinh() Function


Output
Error

 

Ruby – Use of Negative Values in sinh()


Output
-21.048644880883543+71.16172106192103i

 

Ruby – Get the sinh() of Particular Number


Output

1490.4788257895502

 

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