News for hackers. Stuff that matters.
Re:State of the art of random double generation by SamReidHughes on Saturday April 11, 2015 @05:29AM (#9358957)
You don't need to know in advance. Generate a big r from 0 <= r < s. When calling randint(n), return r mod n and update (r, s) = (r/n, s/n), unless r >= s - (s mod n) in which case reset s and regenerate r.

There are no comments on this comment yet.