HP MLIB User's Guide Vol. 2 7th Ed.

614 HP MLIB User’s Guide
RANV VAX-compatible random numbers
Notes CALL RANV (iseed, n, x) produces the same n pseudorandom numbers as
returned by n successive references to RAN(iseed).
CALL RANV (iseed, n, x) produces the same value of iseed that would have
resulted from the last of
n successive references to RAN(iseed).
Starting a sequence twice with the same value of iseed will produce the same
pseudorandom sequence.
You may have as many independent sequences going at a time as you desire by
having a different iseed for each one.
The subprograms treat iseed as an unsigned 32-bit quantity. To write it out for
later continuation of the same sequence, either use unformatted I/O statements
or write it out with an octal, unsigned integer, or hexadecimal format descriptor
of the form O11, SU,I10, or Z8, respectively.
Example Fill an array X that is 10 elements long with a sequence of pseudorandom
numbers using the vector subprogram RANV.
INTEGER*4 ISEED,N
REAL*4 X(10)
ISEED = 1234 ! STARTING SEED
N = 10
CALL RANV (ISEED,N,X)
This fills array X with the same sequence of pseudorandom numbers and also
returns the same final value of ISEED, as the “Example” on page 611 for RAN.