tanh - C math.h

C examples for math.h:tanh

Type

function

From

<cmath>
<ctgmath>
<math.h>

Description

Returns the hyperbolic tangent of x.

Prototype

long double tanhl (long double x);
long double tanh (long double x);
      float tanhf (float x);
     double tanh (double x);
      float tanh (float x);
     double tanh (T x);           

Parameters

Parameter Description
x Value representing a hyperbolic angle.

Return Value

Hyperbolic tangent of x.

Demo Code


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

int main ()/* w w w  . ja  v a 2  s  .c om*/
{
  double param = log(2.0);
  
  double result = tanh (param);
  
  printf ("The hyperbolic tangent of %f is %f.\n", param, result);
  
  return 0;
}

Related Tutorials