class method
Math.tanh
(::Math::double x) -> ::Float
Math.tanh(x) → float
math.c
View on GitHub ↗
static VALUE
math_tanh(VALUE unused_obj, VALUE x)
{
return DBL2NUM(tanh(Get_Double(x)));
}
Returns the hyperbolic tangent of x in radians.
-
Domain:
[-INFINITY, INFINITY]. -
Range:
[-1, 1].
Examples:
Example
tanh(-INFINITY) # => -1.0 tanh(0.0) # => 0.0 tanh(INFINITY) # => 1.0