I'd like to pick a random number out of a huge number.
count is 4.725533031549649e+152
What should I do?
Numpy.random.randint
is said to be only up to int64.
I'd like to pick a random number out of a huge number.
count is 4.725533031549649e+152
What should I do?
Numpy.random.randint
is said to be only up to int64.
You can use random library.
import random
random.randrange(0, 4.725533031549649e+152)
>>> random.randrange(0, 4.725533031549649e+152)
169751096079061489415033502439315971761176373224764849829689981514727862542449749467855540992801413306200508657378631847139186549408966200866106110063885
>>> random.randrange(0, 4.725533031549649e+152)
332802078707358741701843812789346557544950682259596048311950328489197340606292985345468995905214666895030416962534136208301912797321798957162526303349975
>>> random.randrange(0, 4.725533031549649e+152)
195068584125198082963968400124527145219707541804769322353310527845126940493999253420325583765283625874685614529038994101415937997041514293267317713485347
Keep in mind that this generates pseudo-random numbers. Which are not "totally random" from a mathematical perspective.