Ruby Tutorial Ruby References

Ruby - Math.asinh() Method



The Ruby Math.asinh() method returns inverse hyperbolic sine of a value. The inverse hyperbolic sine of x is defined as:

asinh

Syntax

Math.asinh(x)

Parameters

x Specify the value.

Return Value

Returns the inverse hyperbolic sine of a value.

Example:

In the example below, Math.asinh() method is used to find out the inverse hyperbolic sine of a value.

puts "Math.asinh(-4) = #{Math.asinh(-4)}"
puts "Math.asinh(-2) = #{Math.asinh(-2)}"
puts "Math.asinh(0) = #{Math.asinh(0)}"
puts "Math.asinh(2) = #{Math.asinh(2)}"
puts "Math.asinh(4) = #{Math.asinh(4)}"

The output of the above code will be:

Math.asinh(-4) = -2.0947125472611012
Math.asinh(-2) = -1.4436354751788103
Math.asinh(0) = 0.0
Math.asinh(2) = 1.4436354751788103
Math.asinh(4) = 2.0947125472611012

❮ Ruby Math Module