HP 3000 Manuals

RANDOM [ HP COBOL II/XL Quick Reference Guide ] MPE/iX 5.0 Documentation


HP COBOL II/XL Quick Reference Guide

RANDOM 

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

Syntax 

     FUNCTION RANDOM [(parameter-1)]

Parameters 

parameter-1           parameter-1 is used as the seed value to generate a
                      sequence of pseudo-random numbers.  If specified,
                      must be in integer between zero and 999999999,
                      inclusive.

                      If a subsequent reference specifies parameter-1, a
                      new sequence of pseudo-random numbers is started.

                      If the first reference to this function in the run
                      unit does not specify parameter-1, the seed value
                      is zero.  In each case, subsequent references
                      without specifying parameter-1 returns the next
                      number in the current sequence.

                      If parameter-1 is specified, parameter-1 determines
                      a sequence of pseudo-random numbers.  Each time a
                      value is returned, that 32-bit value is used in
                      place of parameter-1 to continue the pseudo-random
                      sequence.



MPE/iX 5.0 Documentation