next up previous
Next: Thread Safety and the Up: The RNG Random Number Previous: Packing and Unpacking RNG

A Note on Mixing Generators

All of the random number generators currently implemented in the RNG library use the type Rng_Type, a 64-bit unsigned object, to implement the random number state. Each generator, however, spans its own range of values governed by the properties of its recurrence relation and any constraints on the starting value used.

The 64-bit lcg described in Section 3.1 spans all possible values of the 64-bit Rng_Type, zero included. The 48-bit lcg of Section 3.2 uses only 48 bits. The state, in this case, spans the range [0,248). The 48-bit CRI compatible LCG of Section 3.3 uses only 48 bits and the state, in this case, must be odd. The prime modulus generators, with modulus P, produce state, x, which spans the range 1$ \le$x < P.

It is important that one does not mix generators for a given random number stream, for example initializing a Rng_Type with the 64-bit generator, and using one of the other generators to produce random values using this random number state. Results of such mixing between generators may be unpredictable.


next up previous
Next: Thread Safety and the Up: The RNG Random Number Previous: Packing and Unpacking RNG