Important: The information in this document is obsolete and should not be used for new development.
tanh
You can use thetanh
function to compute the hyperbolic tangent of a real number.
double_t tanh (double_t x);
x
- Any floating-point number.
DESCRIPTION
Thetanh
function returns the hyperbolic tangent of its argument. The return value is in the range [-1, +1]. This function is antisymmetric.The
atanh
function performs the inverse operation .EXCEPTIONS
When x is finite and nonzero, the result of raises the following exception:
- inexact (for all finite, nonzero values of x)
SPECIAL CASES
Table 10-29 shows the results when the argument to thetanh
function is a zero, a NaN, or an Infinity.
Special cases for the tanh
functionOperation Result Exceptions raised +0 None None NaN None[51] +1 None -1 None EXAMPLES
z = tanh(1.0); /* z 0.761594. The inexact exception is raised. */ z = tanh(-1.0); /* z 0.761594. The inexact exception is raised. */
[51] If the NaN is a signaling NaN, the invalid exception is raised.