fixed more binutils issues (newer gcc/libc)
[zpugcc/jano.git] / toolchain / gcc / newlib / libm / mathfp / s_atan.c
bloba5a81897962abf3c2aa9f2c34f4e7ce014b717c8
2 /* @(#)z_atan.c 1.0 98/08/13 */
4 /*
5 FUNCTION
6 <<atan>>, <<atanf>>---arc tangent
8 INDEX
9 atan
10 INDEX
11 atanf
13 ANSI_SYNOPSIS
14 #include <math.h>
15 double atan(double <[x]>);
16 float atanf(float <[x]>);
18 TRAD_SYNOPSIS
19 #include <math.h>
20 double atan(<[x]>);
21 double <[x]>;
23 float atanf(<[x]>);
24 float <[x]>;
26 DESCRIPTION
28 <<atan>> computes the inverse tangent (arc tangent) of the input value.
30 <<atanf>> is identical to <<atan>>, save that it operates on <<floats>>.
32 RETURNS
33 @ifnottex
34 <<atan>> returns a value in radians, in the range of -pi/2 to pi/2.
35 @end ifnottex
36 @tex
37 <<atan>> returns a value in radians, in the range of $-\pi/2$ to $\pi/2$.
38 @end tex
40 PORTABILITY
41 <<atan>> is ANSI C. <<atanf>> is an extension.
45 /******************************************************************
46 * Arctangent
48 * Input:
49 * x - floating point value
51 * Output:
52 * arctan of x
54 * Description:
55 * This routine returns the arctan of x.
57 *****************************************************************/
59 #include "fdlibm.h"
60 #include "zmath.h"
62 #ifndef _DOUBLE_IS_32BITS
64 double
65 _DEFUN (atan, (double),
66 double x)
68 switch (numtest (x))
70 case NAN:
71 errno = EDOM;
72 return (x);
73 case INF:
74 /* this should check to see if neg NaN or pos NaN... */
75 return (__PI_OVER_TWO);
76 case 0:
77 return (0.0);
78 default:
79 return (atangent (x, 0, 0, 0));
83 #endif /* _DOUBLE_IS_32BITS */