]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Correct long standing bugs in the methods for random distributions.
authorRaymond Hettinger <python@rcn.com>
Sat, 4 Jan 2003 09:30:32 +0000 (09:30 +0000)
committerRaymond Hettinger <python@rcn.com>
Sat, 4 Jan 2003 09:30:32 +0000 (09:30 +0000)
commit63b5156e6e4a01737c333265772c677035fce657
tree3dd41ae1903a87797c4d8c1cf66439c974fea76c
parent65b5e1fdbebe4ca35b665bc22bc51e9a806b4669
Correct long standing bugs in the methods for random distributions.
The range of u=random() is [0,1), so log(u) and 1/x can fail.
Fix by setting u=1-random() or by reselecting for a usable value.
Lib/random.py