Message108441
Either of these looks good to me.
If the last line of the second is changed from "return int(r) % n" to "return int(r) // (N // n)" then it'll use the high-order bits of random() instead of the low-order bits. This doesn't matter for MT, but might matter for subclasses of Random using a different underlying generator. |
|
Date |
User |
Action |
Args |
2010-06-23 08:41:55 | mark.dickinson | set | recipients:
+ mark.dickinson, rhettinger, terry.reedy, belopolsky, vstinner |
2010-06-23 08:41:55 | mark.dickinson | set | messageid: <1277282515.08.0.848728028886.issue9025@psf.upfronthosting.co.za> |
2010-06-23 08:41:51 | mark.dickinson | link | issue9025 messages |
2010-06-23 08:41:51 | mark.dickinson | create | |
|