Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libm / mathfp / s_atan.c
blob53551e56e60c0a1c6754517210ce7cea4b17c169
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 SYNOPSIS
14 #include <math.h>
15 double atan(double <[x]>);
16 float atanf(float <[x]>);
18 DESCRIPTION
20 <<atan>> computes the inverse tangent (arc tangent) of the input value.
22 <<atanf>> is identical to <<atan>>, save that it operates on <<floats>>.
24 RETURNS
25 @ifnottex
26 <<atan>> returns a value in radians, in the range of -pi/2 to pi/2.
27 @end ifnottex
28 @tex
29 <<atan>> returns a value in radians, in the range of $-\pi/2$ to $\pi/2$.
30 @end tex
32 PORTABILITY
33 <<atan>> is ANSI C. <<atanf>> is an extension.
37 /******************************************************************
38 * Arctangent
40 * Input:
41 * x - floating point value
43 * Output:
44 * arctan of x
46 * Description:
47 * This routine returns the arctan of x.
49 *****************************************************************/
51 #include "fdlibm.h"
52 #include "zmath.h"
54 #ifndef _DOUBLE_IS_32BITS
56 double
57 atan (double x)
59 switch (numtest (x))
61 case NAN:
62 errno = EDOM;
63 return (x);
64 case INF:
65 /* this should check to see if neg NaN or pos NaN... */
66 return (__PI_OVER_TWO);
67 case 0:
68 return (0.0);
69 default:
70 return (atangent (x, 0, 0, 0));
74 #endif /* _DOUBLE_IS_32BITS */