2 /* @(#)w_atan2.c 5.1 93/09/24 */
4 * ====================================================
5 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
7 * Developed at SunPro, a Sun Microsystems, Inc. business.
8 * Permission to use, copy, modify, and distribute this
9 * software is freely granted, provided that this notice
11 * ====================================================
17 <<atan2>>, <<atan2f>>---arc tangent of y/x
26 double atan2(double <[y]>,double <[x]>);
27 float atan2f(float <[y]>,float <[x]>);
31 double atan2(<[y]>,<[x]>);
35 float atan2f(<[y]>,<[x]>);
41 <<atan2>> computes the inverse tangent (arc tangent) of <[y]>/<[x]>.
42 <<atan2>> produces the correct result even for angles near
49 (that is, when <[x]> is near 0).
51 <<atan2f>> is identical to <<atan2>>, save that it takes and returns
55 <<atan2>> and <<atan2f>> return a value in radians, in the range of
63 If both <[x]> and <[y]> are 0.0, <<atan2>> causes a <<DOMAIN>> error.
65 You can modify error handling for these functions using <<matherr>>.
68 <<atan2>> is ANSI C. <<atan2f>> is an extension.
80 #ifndef _DOUBLE_IS_32BITS
83 double atan2(double y
, double x
) /* wrapper atan2 */
85 double atan2(y
,x
) /* wrapper atan2 */
90 return __ieee754_atan2(y
,x
);
94 z
= __ieee754_atan2(y
,x
);
95 if(_LIB_VERSION
== _IEEE_
||isnan(x
)||isnan(y
)) return z
;
104 if(_LIB_VERSION
== _POSIX_
)
106 else if (!matherr(&exc
)) {
117 #endif /* defined(_DOUBLE_IS_32BITS) */