random changes

Raymond Hettinger vze4rx4y at verizon.net
Fri Aug 8 12:35:02 EDT 2003


"Chris Reedy"
> It appears that the numbers for random.random() are identical, however,
> the numbers for normalvariate (and also lognormvariate, betavariate,
> weibullvariate, and paretovariate) are different

The underlying random number generator is the same but
the formulas for producing the variates were each changed
a bit so they could handle the full range of possible inputs
(i.e. handling a random() float exactly equal to zero).

The OP's original concern was traced back to a change between
Py2.0 and Py2.1 where the WichmannHill seed routine was
improved (doubling the key space and reducing duplicate
states generated from different seeds).  The whseed() method
was what he needed for backwards compatibility.


Raymond Hettinger






More information about the Python-list mailing list