[Numpy-svn] r5474 - trunk/numpy/core/src

numpy-svn@scip... numpy-svn@scip...
Sun Jul 20 15:35:07 CDT 2008


Author: charris
Date: 2008-07-20 15:35:02 -0500 (Sun, 20 Jul 2008)
New Revision: 5474

Modified:
   trunk/numpy/core/src/umathmodule.c.src
Log:
Fix _SIGN macros for MSVC compilers. Test.


Modified: trunk/numpy/core/src/umathmodule.c.src
===================================================================
--- trunk/numpy/core/src/umathmodule.c.src	2008-07-20 19:32:59 UTC (rev 5473)
+++ trunk/numpy/core/src/umathmodule.c.src	2008-07-20 20:35:02 UTC (rev 5474)
@@ -1683,10 +1683,10 @@
 
 #define BOOL_negative BOOL_logical_not
 
-#define _SIGN1(x) (isnan((x)) ? NAN : ((x) > 0 ? 1 : ((x) < 0 ? -1 : 0)) )
+#define _SIGN1(x) (isnan((x)) ? (x) : ((x) > 0 ? 1 : ((x) < 0 ? -1 : 0)) )
 #define _SIGN2(x) ((x) == 0 ? 0 : 1)
-#define _SIGNC(x) (isnan((x.real)) ? NAN : \
-                   isnan((x.imag)) ? NAN : \
+#define _SIGNC(x) (isnan((x).real) ? (x).real : \
+                   isnan((x).imag) ? (x).imag : \
                    ((x).real > 0) ? 1 : \
                    ((x).real < 0 ? -1 : \
                    ((x).imag > 0 ? 1 : \



More information about the Numpy-svn mailing list