atanhf Function

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

Include

<math.h>

Prototype

float atanhf(float 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)
{
  float x, y;

  x = 0.5;
  y = atanhf(x);
  printf("The arc hyperbolic tangent of %f is %f\n", x, y);

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

Example Output

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