rstates point to rngs
authorAndy Wingo <wingo@pobox.com>
Mon, 26 Jul 2010 14:36:15 +0000 (16:36 +0200)
committerAndy Wingo <wingo@pobox.com>
Mon, 26 Jul 2010 14:36:15 +0000 (16:36 +0200)
commita2a95453eb62dc489e6376f8e987db668837ba14
treefa89aa22d3bd6a03631e0fd9193816b646ad0c2e
parent1d454874c14423072e0b0e9ab7aaaaac81d376e0
rstates point to rngs

* libguile/random.h (scm_t_rstate): Include the rng in the rstate, so we
  can actually have multiple rngs. Instead of reserved0 / reserved1,
  reserve a double explicitly for scm_c_normal01.
  (scm_c_uniform32): Change to call the rstate's rng.

* libguile/random.c: Change to access an rstate's rng through its rng
  pointer.
  (scm_c_normal01): Instead of a flag and a next double, just check that
  the double is equal to 0.0. Excluding one value shouldn't affect the
  distribution, right?
libguile/random.c
libguile/random.h