next up previous contents index
Next: SingleFloat Up: RandomNumberGenerator Previous: randomInteger   Contents   Index


seed


Usage

seed(r, s)


Signature

seed: (%, MachineInteger) $\to$ %


Parameter Type Description
r % a pseudo-random number generator
s MachineInteger a nonzero seed


Description

Sets the seed of r to s and returns s. This is useful when a reproducible pseudo-random sequence is desired. If an unseeded generator is called, then it seeds itself from the system clock the first time it is used, so the sequence is not reproducible. Note that setting the seed to 0 causes the generator to generate an infinite sequence of 0.



Manuel Bronstein 2004-06-28