functions have (almost) the same calling sequence and initialization properties as the
The difference is that
produces a much less random sequence in fact, the low dozen bits
generated by rand go through a cyclic pattern.
All the bits generated by
will produce a random binary
will by default produce a sequence of numbers that can be duplicated
as the seed.
routine initializes a state array using
pseudo-random numbers obtained from the kernel.
Note that this particular seeding
procedure can generate states which are impossible to reproduce by
with any value, since the succeeding terms in the
state buffer are no longer derived from the LC algorithm applied to
a fixed seed.
routine allows a state array, passed in as an argument, to be initialized
for future use.
The size of the state array (in bytes) is used by
to decide how sophisticated a random number generator it should use the
more state, the better the random numbers will be.
(Current "optimal" values for the amount of state information are
8, 32, 64, 128, and 256 bytes; other amounts will be rounded down to
the nearest known amount.
Using less than 8 bytes will cause an error.)
The seed for the initialization (which specifies a starting point for
the random number sequence, and provides for restarting at the same
point) is also an argument.
returns a pointer to the previous state information array.
Once a state has been initialized, the
routine provides for rapid switching between states.
returns a pointer to the previous state array; its
argument state array is used for further random number generation
until the next call to
Once a state array has been initialized, it may be restarted at a
different point either by calling
(with the desired seed, the state array, and its size) or by calling
(with the state array) and
(with the desired seed).
The advantage of calling both
is that the size of the state array does not have to be remembered after
it is initialized.
With 256 bytes of state information, the period of the random number
generator is greater than