Open In App

Ruby CMath sinh() Method with example

Last Updated : 01 Dec, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

sinh() method is Math class which is used to returns the hyperbolic sine of the given value.

Syntax: Math.sinh(z) Parameter: Here, z is the value whose hyperbolic sine is to be calculated. Returns: This method returns the hyperbolic sine value of the z.

Example 1: 

Ruby




# Ruby code for sinh() method
require 'cmath'
 
# Initializing value  
a = 0.3584
b = 2
 
# Printing result   
puts "sinh value of a : #{CMath.sinh(a)}\n\n"
     
puts "sinh value of b : #{CMath.sinh(b)}\n\n"


Output:

sinh value of a : 0.3661222097428432

sinh value of b : 3.626860407847019

Example 2: 

Ruby




# Ruby code for sinh() method
require 'cmath'
 
# Initializing value  
a = 0
b = -0.247
 
# Printing result   
puts "sinh value of a : #{CMath.sinh(a)}\n\n"   
puts "sinh value of b : #{CMath.sinh(b)}\n\n"


Output:

sinh value of a : 0.0

sinh value of b : -0.24951920962344676

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads