6.11.181 tanhl Function
Calculates the hyperbolic tangent function of a long double precision floating-point value.
Include
<math.h>
Prototype
long double tanhl(long double x);
Argument
x
- value for which to return the hyperbolic tangent
Return Value
Returns the hyperbolic tangent of x
in the ranges of -1 to
1 inclusive..
Remarks
No domain or range error will occur.
Example
See the notes at the beginning of this chapter or section for
information on using printf()
or scanf()
(and other functions reading and writing the stdin
or
stdout
streams) in the example code.
#include <math.h>
#include <stdio.h>
int main(void)
{
long double x, y;
x = -1.0F;
y = tanhl(x);
printf("The hyperbolic tangent of %Lf is %Lf\n", x, y);
x = 0.0F;
y = tanhl(x);
printf("The hyperbolic tangent of %Lf is %Lf\n", x, y);
}
Example Output
The hyperbolic tangent of -1.000000 is -0.761594
The hyperbolic tangent of 0.000000 is 0.000000