atanl Function

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

Include

<math.h>

Prototype

double atanl(double x);

Argument

x
value for which to return the arc tangent

Return Value

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

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 = 2.0;
  y = atanl(x);
  printf("The arctangent of %Lf is %Lf\n", x, y);

  x = -1.0;
  y = atanl(x);
  printf("The arctangent of %Lf is %Lf\n", x, y);
}

Example Output

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