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
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
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.