Syntax
#include <math.h> double tanh(double x);Description
tanh calculates the hyperbolic tangent of x, where x is expressed in radians.
tanh returns the value of the hyperbolic tangent of x. The result of tanh cannot have a range error.
This example computes x as the hyperbolic tangent of pi/4.
#include <math.h>
int main(void)
{
double pi,x;
pi = 3.1415926;
x = tanh(pi/4);
printf("tanh( %lf ) = %lf\n", pi/4, x);
return 0;
/****************************************************************************
The output should be:
tanh( 0.785398 ) = 0.655794
****************************************************************************/
}
Related Information