Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

tanh - Hyperbolic tangent

&pagelevel(4)&pagelevel

Definition   

#include <math.h>

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

These functions calculate the hyperbolic tangent function of x. x must be in the permissible range of floating-point numbers.

Return val.

tanh(x)          for a permissible floating-point number x.

Example

The following program outputs the hyperbolic tangent of an input number.

#include <math.h>
#include <stdio.h>
int main(void)
{
     double x;
     printf("Please enter a number :\n");
     scanf("%lf", &x);
     printf("The hyperbolic tangent of %g is %g \n", x, tanh(x));
     return 0;
}

See also

sin, cos, tan, atan