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: <[email protected]> |
| 2010-06-23 08:41:51 | mark.dickinson | link | issue9025 messages |
| 2010-06-23 08:41:51 | mark.dickinson | create | |
|