Keil Logo

atan

Summary
#include <math.h>

double atan (
  double x);   /* number to calculate arc tangent of */
Description

The atan function calculates the arc tangent of the floating-point number x.

Return Value

The atan function returns the arc tangent of x.

For x ∈ (-∞, ∞), atan(x) → (-π/2, π/2).
For x = NaN, atan(x)NaN.
For x = ±INF, atan(x) → ±π/2.

See Also

acos, asin, atan2

Example
#include <math.h>
#include <stdio.h> /* for printf */

void tst_atan (void) {
  float x;
  float y;

  for (x = -10.0; x <= 10.0; x += 0.1) {
    y = atan (x);
    printf ("ATAN(%f) = %f\n", x, y);
  }
}
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.