]> git.proxmox.com Git - mirror_edk2.git/blame - StdLib/LibC/Math/w_atan2.c
ArmPkg: ArmLib: purge incorrect ArmDrainWriteBuffer () alias
[mirror_edk2.git] / StdLib / LibC / Math / w_atan2.c
CommitLineData
2aa62f2b 1/* @(#)w_atan2.c 5.1 93/09/24 */\r
2/*\r
3 * ====================================================\r
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\r
5 *\r
6 * Developed at SunPro, a Sun Microsystems, Inc. business.\r
7 * Permission to use, copy, modify, and distribute this\r
8 * software is freely granted, provided that this notice\r
9 * is preserved.\r
10 * ====================================================\r
11 */\r
12#include <LibConfig.h>\r
13#include <sys/EfiCdefs.h>\r
14#if defined(LIBM_SCCS) && !defined(lint)\r
15__RCSID("$NetBSD: w_atan2.c,v 1.9 2002/05/26 22:01:59 wiz Exp $");\r
16#endif\r
17\r
18/*\r
19 * wrapper atan2(y,x)\r
20 */\r
21\r
22#include "math.h"\r
23#include "math_private.h"\r
24\r
25\r
26double\r
27atan2(double y, double x) /* wrapper atan2 */\r
28{\r
29#ifdef _IEEE_LIBM\r
30 return __ieee754_atan2(y,x);\r
31#else\r
32 double z;\r
33 z = __ieee754_atan2(y,x);\r
34 if(_LIB_VERSION == _IEEE_||isnan(x)||isnan(y)) return z;\r
35 if(x==0.0&&y==0.0) {\r
36 return __kernel_standard(y,x,3); /* atan2(+-0,+-0) */\r
37 } else\r
38 return z;\r
39#endif\r
40}\r