6.11.25 atanhl Function

Calculates the trigonometric arc hyperbolic tangent function of a double precision floating-point value.

Include

<math.h>

Prototype

long double atanh(long double x);

Argument

x
value for which to return the arc hyperbolic tangent

Return Value

Returns the arc hyperbolic tangent of x or NaN if a domain error occurs.

Remarks

If x is not in the range [-1, +1] , a domain error occurs and errno will be set to EDOM.

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 = 0.5;
  y = atanhl(x);
  printf("The arc hyperbolic tangent of %Lf is %Lf\n", x, y);

  x = -1.0;
  y = atanhl(x);
  printf("The arc hyperbolic tangent of %Lf is %Lf\n", x, y);
}

Example Output

The arc hyperbolic tangent of 0.500000 is 0.549306
The arc hyperbolic tangent of -1.000000 is -inf