Closed
Description
Stumbled over this earlier today:
from numpy import uint64, iinfo
from numpy.random import RandomState
uint64_max = iinfo(uint64).max
RandomState(0).randint(uint64_max, dtype=uint64)
# returns 10123822223749065263
RandomState(0).randint(uint64(uint64_max), dtype=uint64)
# raises OverflowError
Traceback:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "mtrand.pyx", line 979, in mtrand.RandomState.randint (numpy/random/mtrand/mtrand.c:16422)
File "mtrand.pyx", line 980, in mtrand.RandomState.randint (numpy/random/mtrand/mtrand.c:16227)
File "randint_helpers.pxi", line 450, in mtrand._rand_uint64 (numpy/random/mtrand/mtrand.c:5637)
OverflowError: Python int too large to convert to C unsigned long
conda 4.3.21
Python 3.5.3.final.0
numpy 1.12.1
osx-64 (El Capitan)