]> granicus.if.org Git - python/commit
Correct long standing bugs in the methods for random distributions.
authorRaymond Hettinger <python@rcn.com>
Sat, 4 Jan 2003 09:26:32 +0000 (09:26 +0000)
committerRaymond Hettinger <python@rcn.com>
Sat, 4 Jan 2003 09:26:32 +0000 (09:26 +0000)
commit73ced7ee995180c0bd8d96ff7d7fb614a744ad7d
tree6f947e5610c1d232c7b2b1267b8ca919331ca01e
parent3a57d9de076d255f5cf46816c07e79a8c9b76ec4
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.

Will backport.
Lib/random.py