➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 mark.dickinson
收信人 mark.dickinson, rhettinger
日期 2010-06-18.12:22:11
SpamBayes Score 2.4642835e-05
Marked as misclassified 否
Message-id <1276863732.9.0.202368142527.issue9025@psf.upfronthosting.co.za>
In-reply-to
内容
Here's an example patch that removes any bias from randrange(n) (except for bias resulting from the imperfectness of the core MT generator).  I added a small private method to Modules/_randommodule.c to aid the computation.

This only fixes one instance of int(random() * n) in the Lib/random.py source;  the other instances should be modified accordingly.

With this patch, randrange is a touch faster than before (20-30% speedup) for small arguments.

Is this worth pursuing?
历史
日期 用户 动作 参数
2010-06-18 12:22:12mark.dickinson修改recipients: + mark.dickinson, rhettinger
2010-06-18 12:22:12mark.dickinson修改messageid: <1276863732.9.0.202368142527.issue9025@psf.upfronthosting.co.za>
2010-06-18 12:22:11mark.dickinson链接issue9025 messages
2010-06-18 12:22:11mark.dickinson创建