OSDN Git Service

ldso: Add remaining relocation types to the table
[uclinux-h8/uClibc.git] / libm / e_atan2.c
index 594b9a1..ef7ffa9 100644 (file)
@@ -1,4 +1,3 @@
-/* @(#)e_atan2.c 5.1 93/09/24 */
 /*
  * ====================================================
  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
@@ -10,10 +9,6 @@
  * ====================================================
  */
 
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_atan2.c,v 1.8 1995/05/10 20:44:51 jtc Exp $";
-#endif
-
 /* __ieee754_atan2(y,x)
  * Method :
  *     1. Reduce y to positive by atan2(y,x)=-atan2(-y,x).
@@ -44,11 +39,7 @@ static char rcsid[] = "$NetBSD: e_atan2.c,v 1.8 1995/05/10 20:44:51 jtc Exp $";
 #include "math.h"
 #include "math_private.h"
 
-#ifdef __STDC__
 static const double
-#else
-static double
-#endif
 tiny  = 1.0e-300,
 zero  = 0.0,
 pi_o_4  = 7.8539816339744827900E-01, /* 0x3FE921FB, 0x54442D18 */
@@ -56,12 +47,7 @@ pi_o_2  = 1.5707963267948965580E+00, /* 0x3FF921FB, 0x54442D18 */
 pi      = 3.1415926535897931160E+00, /* 0x400921FB, 0x54442D18 */
 pi_lo   = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */
 
-#ifdef __STDC__
-       double attribute_hidden __ieee754_atan2(double y, double x)
-#else
-       double attribute_hidden __ieee754_atan2(y,x)
-       double  y,x;
-#endif
+double __ieee754_atan2(double y, double x)
 {
        double z;
        int32_t k,m,hx,hy,ix,iy;
@@ -128,3 +114,21 @@ pi_lo   = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */
                    return  (z-pi_lo)-pi;/* atan(-,-) */
        }
 }
+
+/*
+ * wrapper atan2(y,x)
+ */
+#ifndef _IEEE_LIBM
+double atan2(double y, double x)
+{
+       double z = __ieee754_atan2(y, x);
+       if (_LIB_VERSION == _IEEE_ || isnan(x) || isnan(y))
+               return z;
+       if (x == 0.0 && y == 0.0)
+               return __kernel_standard(y,x,3); /* atan2(+-0,+-0) */
+       return z;
+}
+#else
+strong_alias(__ieee754_atan2, atan2)
+#endif
+libm_hidden_def(atan2)