atan, atanl
raw OCR
Calculates the arc tangent.
Defined in header <math.h>
Syntax
Real versions: Complex version:
#include <math.h> #include <complex.h>
double atan(double x); complex atan(complex x)
long double atanl(long double x);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only | |
|---|---|---|---|---|---|
| atanI | ■ | ■ | |||
| Real atan | ■ | ■ | ■ | ■ | |
| Complex atan | ■ | ■ | ■ |
Remarks
atan calculates the arc tangent of the input value.
atan! is the long double version; it takes a long double argument and returns a long double result.
The complex inverse tangent is defined by
atan(z) = -0.5 i log((l + z z)/(l - i z))
Return value
atan and atanI of a real argument return a value in the range -pi/2 to pi/2.
Error handling for these functions can be modified through the functions matherr and _matherrl.
See also
Example
iinclude <stdio.h>
#include <math.h>
int main(void)
{
double result, x 0.5;
result = atan(x);
printfC'The arc tangent of %lf is %lf\n", x, result);
return(0);
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Extraction notes
- heading `atan, atani` read as `atan, atanl`
Stable link: /3.1/math.h/atan/
· short form /3.1/atan/