tanh()

Computes the hyperbolic tangent.

  #include <math.h>
  
  double tanh(double x);
  
  float tanhf(float);
  
  long double tanhl(long double);    
Parameter

x

A floating-point value.

Remarks

These functions compute the hyperbolic tangent of x.

This facility may not be available on configurations of the EWL that run on platforms that do not have floating-point math capabilities.

Listing: Example of tanh() Usage

#include <math.h>

#include <stdio.h>

int main(void)

{

double x = 0.5;

printf("The hyperbolic tangent of %f is %f.\n",x, tanh(x));

return 0;

}

Output:

The hyperbolic tangent of 0.500000 is 0.462117.