shunwang / numexpr

Automatically exported from code.google.com/p/numexpr
MIT License
0 stars 0 forks source link

numexpr.evaluate('(a*1j)+0') #81

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
numexpr.evaluate('(a*1j)+0')
gives
TypeError: no ordering relation is defined for complex numbers

ver 1.4.2

Original issue reported on code.google.com by majid.al...@gmail.com on 16 May 2012 at 12:27

GoogleCodeExporter commented 9 years ago
line 263 in necompiler.py

Original comment by majid.al...@gmail.com on 16 May 2012 at 2:21

GoogleCodeExporter commented 9 years ago
let me be more clear
In [55]: a=1+3j
In [56]: numexpr.evaluate('a*1+0j')
TypeError: no ordering relation is defined for complex numbers

In [57]: numexpr.evaluate('(1+3j)*1+0j')
Out[57]: array((1+3j))

Original comment by majid.al...@gmail.com on 19 Sep 2012 at 10:51

GoogleCodeExporter commented 9 years ago
The solution! (A HACK!!!)
onejay=1j
then replace all 1j in the string with onejay

Original comment by majid.al...@gmail.com on 20 Sep 2012 at 4:51