summaryrefslogtreecommitdiff
path: root/numpy/core/include
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2016-03-02 15:04:45 -0700
committerCharles Harris <charlesr.harris@gmail.com>2016-03-03 18:41:06 -0700
commit25dd5e5f8ec9b09f4de37e7308eaf179bbb15dc2 (patch)
treed773e06faa1b4eb8c5384eaf05b0b2749b630de7 /numpy/core/include
parentdf3ed28a6d8410e383f79d8ecb670722b8f5c5c9 (diff)
downloadnumpy-25dd5e5f8ec9b09f4de37e7308eaf179bbb15dc2.tar.gz
ENH: Add identity for bitwise_and.
Current value is 1, which only works for the low order bit. Use -1 instead. Closes #7060.
Diffstat (limited to 'numpy/core/include')
-rw-r--r--numpy/core/include/numpy/ufuncobject.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/numpy/core/include/numpy/ufuncobject.h b/numpy/core/include/numpy/ufuncobject.h
index 1cca64b75..e03a7a4a5 100644
--- a/numpy/core/include/numpy/ufuncobject.h
+++ b/numpy/core/include/numpy/ufuncobject.h
@@ -251,15 +251,21 @@ typedef struct _tagPyUFuncObject {
#endif
/*
+ * UFunc has unit of 0, and the order of operations can be reordered
+ * This case allows reduction with multiple axes at once.
+ */
+#define PyUFunc_Zero 0
+/*
* UFunc has unit of 1, and the order of operations can be reordered
* This case allows reduction with multiple axes at once.
*/
#define PyUFunc_One 1
/*
- * UFunc has unit of 0, and the order of operations can be reordered
- * This case allows reduction with multiple axes at once.
+ * UFunc has unit of -1, and the order of operations can be reordered
+ * This case allows reduction with multiple axes at once. Intended for
+ * bitwise_and reduction.
*/
-#define PyUFunc_Zero 0
+#define PyUFunc_MinusOne 2
/*
* UFunc has no unit, and the order of operations cannot be reordered.
* This case does not allow reduction with multiple axes at once.