tanh
double  tanh ( double x );
math.h
  cplusplus.com  

Calculate hyperbolic tangent.
  Returns hyperbolic tangent of x.

Parameters.

x
Angle expressed in radians (180 degrees = PI radians).

Return Value.
  Hyperbolic tangent of x.

Portability.
  Defined in ANSI-C.
  ANSI-C++ adds float and double overloaded versions of this function, with the same bahavior but being both, parameter and result, of one of these types.

Example.

/* tanh example */
#include <stdio.h>
#include <math.h>

#define PI 3.14159265

main ()
{
  double param, result;
  param = 45;
  result = tanh (param*PI/180);
  printf ("Hyperbolic tangent of %lf degrees is %lf\n", param, result );
  return 0;
}
Output:
Hyperbolic tangent of 45.000000 degrees is 0.655794

See also.
  cosh, sinh, tan


© The C++ Resources Network, 2000