Message246531
> It skews the distribution a tiny little bit, ...
But it doesn't - that's the point ;-)
If double-rounding doesn't occur at all (which appears to be the case on most platforms), absolutely nothing changes (because min(int(random() * N), N-1) == int(random() * N) on such boxes).
If double-rounding does occur, double-rounding itself may change results "all over the place", and I haven't tried to analyze what effects that has on the distribution. In the comparative handful of cases where int(random() * N) == N on such boxes, clamping that back to N-1 just yields the same result we would have gotten on a box that didn't do double-rounding. |
|
Date |
User |
Action |
Args |
2015-07-09 23:42:22 | tim.peters | set | recipients:
+ tim.peters, rhettinger, mark.dickinson, pitrou, vstinner, steven.daprano, r.david.murray, skrah, serhiy.storchaka, Serge Anuchin |
2015-07-09 23:42:22 | tim.peters | set | messageid: <1436485342.81.0.84337103251.issue24567@psf.upfronthosting.co.za> |
2015-07-09 23:42:22 | tim.peters | link | issue24567 messages |
2015-07-09 23:42:22 | tim.peters | create | |
|