Skip to content
class method

Math.tanh

(::Math::double x) -> ::Float
Math.tanh(x) → float

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
See also .tan .sqrt also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0