The RANDOM Function

The RANDOM function returns a numeric value that is a pseudo-random number from a rectangular distribution. The type of this function is numeric.

General Format



  1. If argument-1 is specified, it must be zero or a positive integer. It is used as the seed value to generate a sequence of pseudo-random numbers.
  2. If a subsequent reference specifies argument-1, a new sequence of pseudo-random numbers is started.
  3. MF If the first reference to this function in the run unit does not specify argument-1, the seed value of zero is used.
  4. In each case, subsequent references without specifying argument-1 return the next number in the current sequence.

Returned Values

  1. The returned value is greater than or equal to zero and less than one.
  2. For a given seed value on a given implementation, the sequence of pseudo-random numbers will always be the same.
  3. The domain of argument-1 values will yield distinct sequences of pseudo-random numbers. This subset includes the values from 0 through at least 32767.
  4. Floating-point format is used for numeric non-integer results.