A 32-bit pseudorandom number generator.
Uses PCG32, an algorithm of the permuted congruential generator family, offering very strong randomness.
It can be created via PcgRandom(seed) or PcgRandom(seed, sequence).
Note that math.random works about 19.3 times as fast as this.
- next() — return next integer random number
- next(min, max) — return next integer random number
- rand_normal_dist(min, max, num_trials=6) — return normally distributed random number
- This is only a rough approximation of a normal distribution with mean=(max-min)/2 and variance=1
- Increasing num_trials improves accuracy of the approximation