Closed suokunlong closed 3 months ago
That is the expected result. The pcg32
generator is a 32-bit generator, so it generates values within the 32-bit range.
Version 2.0.0 released just now adds support for the 64-bit case (on some platforms) but if you need arbitrarily large integer support, it is not the right library.
Do you have any idea of any fast random generator for big int (up to 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141)?
Random.randint() (and random.randrange()) is very slow - it takes 20+ seconds to generate 10,000,000 random ints.
Do you have any idea of any fast random generator for big int
Currently, I do not.
What is the use case? Why do you do this?
Steps to Reproduce:
Result: OverflowError: Python int too large to convert to C long.
Result: 103122144310615264154150719382125058357621691471641913955502053264321705091936