Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libm / mathfp / s_atan2.c
blobd8ba3a2b11309b509465ad2e5ecc3a56988d9228
2 /* @(#)z_atan2.c 1.0 98/08/13 */
4 /*
5 FUNCTION
6 <<atan2>>, <<atan2f>>---arc tangent of y/x
8 INDEX
9 atan2
10 INDEX
11 atan2f
13 SYNOPSIS
14 #include <math.h>
15 double atan2(double <[y]>,double <[x]>);
16 float atan2f(float <[y]>,float <[x]>);
18 DESCRIPTION
20 <<atan2>> computes the inverse tangent (arc tangent) of <[y]>/<[x]>.
21 <<atan2>> produces the correct result even for angles near
22 @ifnottex
23 pi/2 or -pi/2
24 @end ifnottex
25 @tex
26 $\pi/2$ or $-\pi/2$
27 @end tex
28 (that is, when <[x]> is near 0).
30 <<atan2f>> is identical to <<atan2>>, save that it takes and returns
31 <<float>>.
33 RETURNS
34 <<atan2>> and <<atan2f>> return a value in radians, in the range of
35 @ifnottex
36 -pi to pi.
37 @end ifnottex
38 @tex
39 $-\pi$ to $\pi$.
40 @end tex
42 If both <[x]> and <[y]> are 0.0, <<atan2>> causes a <<DOMAIN>> error.
44 PORTABILITY
45 <<atan2>> is ANSI C. <<atan2f>> is an extension.
50 /******************************************************************
51 * Arctangent2
53 * Input:
54 * v, u - floating point values
56 * Output:
57 * arctan2 of v / u
59 * Description:
60 * This routine returns the arctan2 of v / u.
62 *****************************************************************/
64 #include "fdlibm.h"
65 #include "zmath.h"
67 #ifndef _DOUBLE_IS_32BITS
69 double
70 atan2 (double v,
71 double u)
73 return (atangent (0.0, v, u, 1));
76 #endif /* _DOUBLE_IS_32BITS */