numpy bug?

Huaiyu Zhu hzhu at knowledgetrack.com
Fri Jun 16 20:18:34 EDT 2000


>>> from Numeric import *
>>> a = arange(16)
>>> (a-5)/4
array([-1, -1,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,  1,  2,  2,  2])


I believe this is not correct.  And the stock python gives correct result:

>>> for i in a: print -i/4
... 
0
-1
-1
-1
-1
-2
-2
-2
-2
-3
-3
-3
-3
-4
-4
-4

Any enlightenments?


-- 
Huaiyu Zhu                       hzhu at users.sourceforge.net
Matrix for Python Project        http://MatPy.sourceforge.net 



More information about the Python-list mailing list