tanh, tanhf —
hyperbolic tangent function
#include <math.h>
double
tanh(double
x);
float
tanhf(float
x);
The tanh() and tanhf() functions
compute the hyperbolic tangent of x. For a discussion of
error due to roundoff, see
math(3).
Upon successful completion, these functions return the hyperbolic tangent value.
The following may also occur:
- If x is ± 0, x is
returned.
- If x is NaN, a NaN is returned.
- If x is positive infinity, a value 1 is returned; if
x is negative infinity, -1 is returned.
- If x is subnormal, a range error can occur and
x is returned.
The described functions conform to ISO/IEC 9899:1999
(“ISO C99”).