Fix random number generator on 64-bit platforms
authorAndreas Rottmann <a.rottmann@gmx.at>
Mon, 19 Jul 2010 20:40:56 +0000 (22:40 +0200)
committerAndy Wingo <wingo@pobox.com>
Mon, 19 Jul 2010 20:40:56 +0000 (22:40 +0200)
commit442eaa681b0c2db4254d4903f8a0996b4ffc83d0
treed28496035ffbc5e179218cad7a82f7783be00459
parentd68a81e038597ba3d47f39b4cd8a5864953dc1d5
Fix random number generator on 64-bit platforms

* libguile/random.c (scm_c_random): On platforms where `unsigned long' has 64
  bit, generate up to 64 bit of randomness. This is expected by
  scm_c_random_bignum(), and hence was a serious distortion of the random value
  distribution for values exceeding 2^32. This change also fixes a crash when
  the `m' argument is a value above 2^32.
libguile/random.c