Permalink
Browse files

BUG: Fix complex to bool conversion in lowlevel_strided_loops

Closes "Ticket 2218".
  • Loading branch information...
1 parent fd63e8f commit f085bc29c5c5fe47c2e1c5481aef016917439cd1 @seberg committed Oct 1, 2012
Showing with 10 additions and 2 deletions.
  1. +10 −2 numpy/core/src/multiarray/lowlevel_strided_loops.c.src
@@ -811,9 +811,17 @@ static void
dst_value[0] = _CONVERT_FN(src_value[0]);
dst_value[1] = _CONVERT_FN(src_value[1]);
# elif !@aligned@
- dst_value = _CONVERT_FN(src_value[0]);
+# if @is_bool2@
+ dst_value = _CONVERT_FN(src_value[0]) || _CONVERT_FN(src_value[1]);
+# else
+ dst_value = _CONVERT_FN(src_value[0]);
+# endif
# else
- *(_TYPE2 *)dst = _CONVERT_FN(src_value[0]);
+# if @is_bool2@
+ *(_TYPE2 *)dst = _CONVERT_FN(src_value[0]) || _CONVERT_FN(src_value[1]);
+# else
+ *(_TYPE2 *)dst = _CONVERT_FN(src_value[0]);
+# endif
# endif
#else
# if @is_complex2@

0 comments on commit f085bc2

Please sign in to comment.