calculate the hyperbolic tangent
#include <math.h> double tanh( double x );
The tanh() function computes the hyperbolic tangent of x.
When the x argument is large, partial or total loss of significance may occur. The matherr() function is invoked in this case.
The hyperbolic tangent value. When an error has occurred, errno indicates the type of error detected.
#include <stdio.h> #include <math.h> void main() { printf( "%f\n", tanh(.5) ); }
produces the output:
0.462117
ANSI
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
cosh(), errno, sinh(), matherr()