# Ruby code for sinh() methodrequire'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"
Ruby
输出
sinh value of a :0.3661222097428432
sinh value of b :3.626860407847019
Ruby
例2 :
# Ruby code for sinh() methodrequire'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"
Ruby
输出
sinh value of a :0.0
sinh value of b :-0.24951920962344676