D.1.5 RAN Function

The RAN function is a general random number generator of the multiplicative congruential type. The result is a floating-point number that is uniformly distributed in the range between 0.0 inclusive and 1.0 exclusive. The call to RAN takes the following form:

y = RAN (i)
y
Is set equal to the value associated, by the function, with the argument i. The argument i is called the seed. It must be an INTEGER*4 variable or INTEGER*4 array element.

The argument should initially be set to a large, odd integer value. The RAN function stores a value in the argument that it later uses to calculate the next random number.

There are no restrictions on the seed, although it should be initialized with different values on separate runs in order to obtain different random numbers.


Previous Page Next Page Table of Contents