C atan function calculates the arc tangent

Syntax

C atan functions has the following syntax.

  • float atanf(float arg);
  • double atan(double arg);
  • long double atanl(long double arg);

C atan functions are from header file math.h.

Description

C atan function returns the arc tangent of arg.

Example

The following code shows how to calculate the arc tangent.


#include <math.h>
#include <stdio.h>
//from   w ww .  j a  v a2 s. c  o  m
int main(void)
{
  double val = -1.0;

  do {
    printf("Arc tangent of %f is %f.\n", val, atan(val));
    val += 0.1;
  } while(val<=1.0);

  return 0;
}

The code above generates the following result.





















Home »
  C Language »
    Function Reference »




assert.h
ctype.h
math.h
setjmp.h
signal.h
stdio.h
stdlib.h
string.h
time.h
wctype.h