Implementation status: partially implemented


#include <math.h>

double atan(double x);
float atanf(float x);
long double atanl(long double x);


These functions return the principal value of the arc tan of x, expressed in radians.

x - the value for which arc tan is computed.

Return value

Upon successful completion, the function returns the arc tangent of x in the range [-π/2,π/2] radians.

If x is NaN, a NaN is returned.

If x is ±0, x is returned.

If x is ±Inf, ±π/2 is returned.

If x is subnormal, a range error occurs and x is returned.


[ERANGE] (Range Error) - the value of x is subnormal.

If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno is set to [ERANGE]. If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception is raised.

On error, the expressions (math_errhandling & MATH_ERRNO) and (math_errhandling & MATH_ERREXCEPT) are independent of each other, but at least one of them must be non-zero.