diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2008-07-20 20:35:02 +0000 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2008-07-20 20:35:02 +0000 |
commit | 2de0cbb31f82437601eca2df23f53525e5fb204d (patch) | |
tree | 0d99e7619c1160d1f3560f1e4524f99d6d617f3f | |
parent | 20a3dc5b74166d985b75471f0ea55d49575445dd (diff) | |
download | numpy-2de0cbb31f82437601eca2df23f53525e5fb204d.tar.gz |
Fix _SIGN macros for MSVC compilers. Test.
-rw-r--r-- | numpy/core/src/umathmodule.c.src | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/core/src/umathmodule.c.src b/numpy/core/src/umathmodule.c.src index 760d6d57e..d037d9137 100644 --- a/numpy/core/src/umathmodule.c.src +++ b/numpy/core/src/umathmodule.c.src @@ -1683,10 +1683,10 @@ static void #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 : \ |