tanh

calculate the hyberbolic tangent

Synopsis:

#include <math.h>
double tanh( double x );

Description:

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.

Returns:

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.

See also:

cosh(), errno, sinh(), matherr()

Examples:

#include <stdio.h>
#include <math.h>

void main()
  {
    printf( "%f\n", tanh(.5) );
  }

produces the output:

0.462117

Classification:

ANSI

Systems:

Math