calculate the hyberbolic 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 tanh() function returns the hyperbolic tangent value. When an error has occurred, errno contains a value that indicates the type of error that has been detected.
cosh(), errno, sinh(), matherr()
#include <stdio.h> #include <math.h> void main() { printf( "%f\n", tanh(.5) ); }
produces the output:
0.462117
ANSI
Math