What steps will reproduce the problem?
1. a = arange(10)
2. numexpr.evaluate('(a == a) + (a == a)')
What is the expected output? What do you see instead?
boolean array of length 10 with values 2. Python also
treats boolean values as integers for addition / multiplication
What version of the product are you using? On what operating system?
numexpr 1.4.2 on Ubuntu 12.04 64bit
Please provide any additional information below.
Workaround would be numexpr.evaluate('1 * (a == a) + (a == a)') which
causes a cast to integer.
In this specific case i used boolean algebra as a workaround to implement
sign(): sign(a) := (a > 0) - (a < 0)
Original issue reported on code.google.com by wayne.st...@googlemail.com on 7 Jan 2013 at 11:27
Original issue reported on code.google.com by
wayne.st...@googlemail.com
on 7 Jan 2013 at 11:27