
29 Jun
2011
29 Jun
'11
1:41 p.m.
Still, for a very cheap source generating on a larger interval than you desired one, it likely wouldn't compete with the classic modulus, test, and throw away and repeat if not acceptable approach. Way more flexible though.
This was educational. I didn't know that approach was "classic". I used it because it seemed intuitive and I checked and saw that GMP does the same thing for *mpz_urandomm*. But I like the idea of using that leftover randomness!