]> granicus.if.org Git - python/commitdiff
Revert parts of patch #453627, documenting the resulting test failures
authorMartin v. Löwis <martin@v.loewis.de>
Thu, 6 Sep 2001 08:16:17 +0000 (08:16 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Thu, 6 Sep 2001 08:16:17 +0000 (08:16 +0000)
instead.

Modules/cmathmodule.c
Modules/mathmodule.c
Objects/complexobject.c
README
acconfig.h
pyconfig.h.in

index 34b0ce85f31fe11b4f09d0e3c5bdb75bdef8c217..adf76b8a331dd5e3b228c283d91dd3ad3e1d97e3 100644 (file)
@@ -8,22 +8,6 @@
 #define M_PI (3.141592653589793239)
 #endif
 
-#ifdef SCO_ATAN2_BUG
-/*
- * UnixWare 7+ is known to have a bug in atan2 that will return PI instead
- * of ZERO (0) if the first argument is ZERO(0).
- */
-static double atan2_sco(double x, double y)
-{
-       if (x == 0.0)
-               return (double)0.0;
-       return atan2(x, y);
-}
-#define ATAN2  atan2_sco
-#else
-#define ATAN2  atan2
-#endif
-
 /* First, the C functions that do the real work */
 
 /* constants */
@@ -175,7 +159,7 @@ c_log(Py_complex x)
 {
        Py_complex r;
        double l = hypot(x.real,x.imag);
-       r.imag = ATAN2(x.imag, x.real);
+       r.imag = atan2(x.imag, x.real);
        r.real = log(l);
        return r;
 }
@@ -191,7 +175,7 @@ c_log10(Py_complex x)
 {
        Py_complex r;
        double l = hypot(x.real,x.imag);
-       r.imag = ATAN2(x.imag, x.real)/log(10.);
+       r.imag = atan2(x.imag, x.real)/log(10.);
        r.real = log10(l);
        return r;
 }
index 379fecbf1b1708e1f5ba3f914dff6fe09bbed548..4609f6040f448f5ecba8e3144c33d8d1e0b8656c 100644 (file)
@@ -12,22 +12,6 @@ extern double modf (double, double *);
 #endif /* __STDC__ */
 #endif /* _MSC_VER */
 
-#ifdef SCO_ATAN2_BUG
-/*
- * UnixWare 7+ is known to have a bug in atan2 that will return PI instead
- * of ZERO (0) if the first argument is ZERO(0).
- */
-static double atan2_sco(double x, double y)
-{
-       if (x == 0.0)
-               return (double)0.0;
-       return atan2(x, y);
-}
-#define ATAN2  atan2_sco
-#else
-#define ATAN2  atan2
-#endif
-
 /* Call is_error when errno != 0, and where x is the result libm
  * returned.  is_error will usually set up an exception and return
  * true (1), but may return false (0) without setting up an exception.
@@ -115,7 +99,7 @@ FUNC1(asin, asin,
       "asin(x)\n\nReturn the arc sine (measured in radians) of x.")
 FUNC1(atan, atan,
       "atan(x)\n\nReturn the arc tangent (measured in radians) of x.")
-FUNC2(atan2, ATAN2,
+FUNC2(atan2, atan2,
       "atan2(y, x)\n\nReturn the arc tangent (measured in radians) of y/x.\n"
       "Unlike atan(y/x), the signs of both x and y are considered.")
 FUNC1(ceil, ceil,
index dde64498936c0758102a00c237b80752974d8db5..740499319a9fef3b754eb5332adde7bf63afd9ae 100644 (file)
 #define PREC_REPR      17
 #define PREC_STR       12
 
-#ifdef SCO_ATAN2_BUG
-/*
- * UnixWare 7+ is known to have a bug in atan2 that will return PI instead
- * of ZERO (0) if the first argument is ZERO(0).
- */
-static double atan2_sco(double x, double y)
-{
-       if (x == 0.0)
-               return (double)0.0;
-       return atan2(x, y);
-}
-#define ATAN2  atan2_sco
-#else
-#define ATAN2  atan2
-#endif
-
 /* elementary operations on complex numbers */
 
 static Py_complex c_1 = {1., 0.};
@@ -154,7 +138,7 @@ c_pow(Py_complex a, Py_complex b)
        else {
                vabs = hypot(a.real,a.imag);
                len = pow(vabs,b.real);
-               at = ATAN2(a.imag, a.real);
+               at = atan2(a.imag, a.real);
                phase = at*b.real;
                if (b.imag != 0.0) {
                        len /= exp(at*b.imag);
diff --git a/README b/README
index 59c969e46a8958e457d2f47a3f4569f54b6cd712..ee9e5d2272ec811f72b5295cb0edcaf1741ab1ce 100644 (file)
--- a/README
+++ b/README
@@ -296,6 +296,11 @@ SCO:       The following apply to SCO 3 only; Python builds out of the box
 
                LIBS=' -lsocket -lcrypt_i'
 
+UnixWare: There are known bugs in the math library of the system, as well as
+        problems in the handling of threads (calling fork in one
+        thread may interrupt system calls in others). Therefore, test_math and
+        tests involving threads will fail until those problems are fixed.
+
 SunOS 4.x: When using the SunPro C compiler, you may want to use the
        '-Xa' option instead of '-Xc', to enable some needed non-ANSI
        Sunisms.
index 8432f1fa7259ed67229756aff38fd4f938433fc4..ffe65aa0c47d14ad5f5936f18b1f0139194d1937 100644 (file)
 
 /* Define the macros needed if on a UnixWare 7.x system. */
 #if defined(__USLC__) && defined(__SCO_VERSION__)
-#define SCO_ACCEPT_BUG     /* Use workaround for UnixWare accept() bug */
-#define SCO_ATAN2_BUG      /* Use workaround for UnixWare atan2() bug */
 #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
 #endif
 
index 662955f5bc85700c2f193bce8f720d56ce4f9684..4ed22eb4cbadf7701c2a6a5f274d6b97a2c23db2 100644 (file)
 
 /* Define the macros needed if on a UnixWare 7.x system. */
 #if defined(__USLC__) && defined(__SCO_VERSION__)
-#define SCO_ACCEPT_BUG     /* Use workaround for UnixWare accept() bug */
-#define SCO_ATAN2_BUG      /* Use workaround for UnixWare atan2() bug */
 #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
 #endif