Re: [Numpy-discussion] Uint64 casting bug for MSVC builds

2014-12-03 Thread Christoph Gohlke
On 12/3/2014 8:44 AM, Matthew Brett wrote: > Hi, > > I just noticed this using Christophe Gohlke's MKL builds of numpy: > import numpy as np val = 2**63 + 2**62 np.float64(val) > 1.3835058055282164e+19 np.float64(val).astype(np.uint64) > 9223372036854775808 > > In general it see

Re: [Numpy-discussion] Uint64 casting bug for MSVC builds

2014-12-03 Thread Jaime Fernández del Río
On Wed, Dec 3, 2014 at 8:44 AM, Matthew Brett wrote: > Hi, > > I just noticed this using Christophe Gohlke's MKL builds of numpy: > > >>> import numpy as np > >>> val = 2**63 + 2**62 > >>> np.float64(val) > 1.3835058055282164e+19 > >>> np.float64(val).astype(np.uint64) > 9223372036854775808 > I

[Numpy-discussion] Uint64 casting bug for MSVC builds

2014-12-03 Thread Matthew Brett
Hi, I just noticed this using Christophe Gohlke's MKL builds of numpy: >>> import numpy as np >>> val = 2**63 + 2**62 >>> np.float64(val) 1.3835058055282164e+19 >>> np.float64(val).astype(np.uint64) 9223372036854775808 In general it seems that floats get clipped at 2**63 when casting to uint64.