[issue9025] Non-uniformity in randrange for large arguments.
STINNER Victor
report at bugs.python.org
Thu Jun 24 03:41:34 CEST 2010
STINNER Victor <victor.stinner at haypocalc.com> added the comment:
randint.py: another algorithm to generate a random integer in a range. It uses only operations on unsigned integers (no evil floatting point number). It calls tick() multiple times to generate enough entropy. It has an uniform distribution (if the input generator has an uniform distribution).
tick() is simply the output of the Mersenne Twister generator. The algorithm can be optimized (especially the part computing ndigits and scale).
----------
Added file: http://bugs.python.org/file17757/randint.py
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9025>
_______________________________________
More information about the Python-bugs-list
mailing list