tanh

Calculates the hyperbolic tangent of x.

Special Values
xtanh(x)invalid?
±0.0±0.0no
±∞±1.0no
  1. real tanh(real x)
    @safe pure nothrow @nogc
    real
    tanh
    (
    real x
    )
  2. double tanh(double x)
  3. float tanh(float x)

Examples

import std.math.operations : isClose;
import std.math.traits : isIdentical;

assert(isIdentical(tanh(0.0), 0.0));
assert(tanh(1.0).isClose(sinh(1.0) / cosh(1.0)));

Meta