English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
C Library Function double tanh(double x) Returns x hyperbolic tangent value.
Below is the declaration of the tanh() function.
double tanh(double x)
x -- Floating-point value.
This function returns the hyperbolic tangent of x.
The following example demonstrates the usage of the tanh() function.
#include <stdio.h> #include <math.h> int main() { double x, ret; x = 0.87; ret = tanh(x); printf("%lf's hyperbolic tangent is %lf degrees", x, ret); return(0); }
Let's compile and run the above program, which will produce the following results:
0.87The hyperbolic tangent of 0.0000 is 0.701374