On 11/14/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> The other problem with using modulo is that it makes the result depend
> mostly on the low-order bits of the random() result, rather than mostly
> on the high-order bits; with lower-grade implementations of random(),
> the lower bits are materially less random than the higher. Now
> admittedly high-grade randomness is probably not too important for this
> specific context, but I dislike putting in poor coding practices that
> someone might see and copy without thinking...
If there's a dependency on a particular quality of random()
implementation, why not just include one? Mersenne Twister is easy,
while not being cryptographic strength.
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html