[Numpy-svn] r8210 - trunk/numpy/core/src/multiarray

numpy-svn@scip... numpy-svn@scip...
Sat Feb 20 20:49:22 CST 2010


Author: ptvirtan
Date: 2010-02-20 20:49:22 -0600 (Sat, 20 Feb 2010)
New Revision: 8210

Modified:
   trunk/numpy/core/src/multiarray/scalartypes.c.src
Log:
3K: ENH: core: follow Python in formatting negative zeros in (-0+x*j)

Modified: trunk/numpy/core/src/multiarray/scalartypes.c.src
===================================================================
--- trunk/numpy/core/src/multiarray/scalartypes.c.src	2010-02-21 02:49:04 UTC (rev 8209)
+++ trunk/numpy/core/src/multiarray/scalartypes.c.src	2010-02-21 02:49:22 UTC (rev 8210)
@@ -410,7 +410,11 @@
     /*
      * Ideally, we should handle this nan/inf stuff in NumpyOS_ascii_format*
      */
+#if PY_VERSION_HEX >= 0x03000000
+    if (val.real == 0.0 && npy_signbit(val.real) == 0) {
+#else
     if (val.real == 0.0) {
+#endif
         PyOS_snprintf(format, sizeof(format), _FMT1, prec);
         res = NumPyOS_ascii_format@type@(buf, buflen-1, format, val.imag, 0);
         if (res == NULL) {



More information about the Numpy-svn mailing list