The tanhf, tanhl, tanh, tanhd32, tanhd64, and tanhd128 subroutines compute the hyperbolic tangent of the x .
An application wishing to check for error situations should set the errno global variable to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these subroutines. Upon return, if errno is nonzero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is nonzero, an error has occurred.
Computes the hyperbolic tangent.
#include <math.h>
float tanhf (x)
float x;
long double tanhl (x)
long double x;
double tanh (x)
double x;
_Decimal32 tanhd32 (x)
_Decimal32 x;
_Decimal64 tanhd64 (x)
_Decimal64 x;
_Decimal128 tanhd128 (x)
_Decimal128 x;
Item | Description |
---|---|
x | Specifies the value to be computed. |
Upon successful completion, the tanhf, tanhl, tanh, tanhd32, tanhd64, and tanhd128 subroutines return the hyperbolic tangent of x.
If x is NaN, a NaN is returned.
If x is ±0, x is returned.
If x is ±Inf, ±1 is returned.
If x is subnormal, a range error may occur and x should be returned.