[Numpy-discussion] float64scalar and divmod (and numpy 0.9.8)

PGM pgmdevlist at gmail.com
Mon Jul 24 06:02:24 EDT 2006


Folks ,
I'm still using numpy 0.9.8 and just ran into this problem on my machine 
(AMD64):

>>> import numpy as N
>>> x = N.array([1.23456])
>>> print divmod(x,1)
(array([ 1.]), array([ 0.23456]))
>>> print divmod(x[0],1)
()
>>> print divmod(x.tolist()[0],1)
(1.0, 0.2345600000000001)

divmod doesn't seem to like '<f8's. Forcing x to '<f4' seems to do the 
trick...
Did anybody run into this problem already ? Is it really numpy related ? If 
this is a bug on 0.9.8, has it been corrected already ?

Thanks a lot
P.





More information about the NumPy-Discussion mailing list