This function generates uniformly distributed pseudo-random numbers. Random numbers are generated in the ranges and random integers in where is speciﬁed by the user.
A multiplicative congruent method is used where a 31 bit generator word is maintained. On each call to the subroutine is updated to ; the initial value of is 1. Depending upon the type of random number required the following are computed ; or .
The subroutine also provides the facility for saving the current value of the generator word and for re-starting with any speciﬁed value.