Table of Contents

tanh

    double tanh(double);

Returns hyperbolic tangent of a radian angle x.

C Sourcecode Example

compile with tanh.c -o tanh -lm

#include <stdio.h> /* including standard library */
//#include <windows.h> /* uncomment this for Windows */
 
#include <math.h> /* including math library */
 
int main( void )
{
    double x;
    x = log(42);
    printf ("hyperbolic tangent of 42 is %lf\n", tanh (x) );
    return 0;
}

output

 output:
 user@host:~$ ./tanh 
 hyperbolic tangent of 42 is 0.998867