Double-precision floating point (±1.7E±308, ~15 decimal digits)
1st Parameter
The value for which the hyperbolic tangent is to be computed.
Read more about parameters of tanh in parameters section
The tanhfunction in C language Calculates the hyperbolic tangent of the specified number.
The tanh function computes the hyperbolic tangent of x. It is defined mathematically as sinh(x) / cosh(x), or equivalently, (e^x - e^-x) / (e^x + e^-x), where e is Euler's number (approximately 2.71828). The hyperbolic tangent function always returns a value between -1 and 1.
The tanhfunction takes 1
parameter:
•
double `x`: The value for which the hyperbolic tangent is to be computed.
Computes the hyperbolic tangent of `x`, defined as sinh(x)/cosh(x). Returns a `double` representing the result. The output will always be in the range (-1, 1).
The tanh function return value :
Returns the hyperbolic tangent of x, a value between -1 and 1
Output
This example calculates the hyperbolic tangent of 1.0.