atan, atanf, atanl

Header: <math.h>

1-6) Computes the principal value of the arc tangent of arg.

# Declarations

float atanf( float arg );

(since C99)

double atan( double arg );
long double atanl( long double arg );

(since C99)

_Decimal32 atand32( _Decimal32 arg );

(since C23)

_Decimal64 atand64( _Decimal64 arg );

(since C23)

_Decimal128 atand128( _Decimal128 arg );

(since C23)

#define atan( arg )

(since C99)

# Parameters

# Return value

If a range error occurs due to underflow, the correct result (after rounding) is returned.

# Notes

POSIX specifies that in case of underflow, arg is returned unmodified, and if that is not supported, an implementation-defined value no greater than DBL_MIN, FLT_MIN, and LDBL_MIN is returned.

# Example

#include <math.h>
#include <stdio.h>
 
int main(void)
{
    printf("atan(1) = %f, 4*atan(1)=%f\n", atan(1), 4 * atan(1));
    // special values
    printf("atan(Inf) = %f, 2*atan(Inf) = %f\n", atan(INFINITY), 2 * atan(INFINITY));
    printf("atan(-0.0) = %+f, atan(+0.0) = %+f\n", atan(-0.0), atan(0));
}

# See also