-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 04/22/2010 02:43 PM, Stephen Gallagher wrote:
Nack.
While this is clearly not a case where random values need to be highly
random, on some implementations rand() is not uniformly distributed in
the low-order bits. In order to be more portable, we should use
selected = (int)((total + 1) * (rand()/(RAND_MAX + 1.0)))
Thanks for the suggestion, a new patch is attached, also fixes a
whitespace issue.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora -
http://enigmail.mozdev.org/
iEYEARECAAYFAkvQeHAACgkQHsardTLnvCUiSwCfSVIOBeFQ3w+jsusHLWzddJwI
MwAAniAJd8ZpVqU0+Nl4NYHunJAmlxoC
=Gx8T
-----END PGP SIGNATURE-----