atanf Function

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

Include

<math.h>

Prototype

float atanf (float x);

Argument

x
value for which to return the arc tangent

Return Value

Returns the arc tangent in radians in the range of -pi/2 to +pi/2 (inclusive).

Remarks

No domain or range error will occur.

Example

#include <math.h>
#include <stdio.h>

int main(void)
{
  float x, y;

  x = 2.0F;
  y = atanf (x);
  printf("The arctangent of %f is %f\n", x, y);

  x = -1.0F;
  y = atanf (x);
  printf("The arctangent of %f is %f\n", x, y);
}

Example Output

The arctangent of 2.000000 is 1.107149
The arctangent of -1.000000 is -0.785398