HP 3000 Manuals

RAND (or RAND') [ Compiler Library/XL Reference Manual ] MPE/iX 5.0 Documentation


Compiler Library/XL Reference Manual

RAND (or RAND') 

RAND generates the next element of a sequence of pseudo-random numbers.

Declaration 

        FUNCTION RAND(VAR x:INTEGER):REAL; EXTERNAL;

Attributes 

Parameter:                A integer number.

Results:                  A representable real number uniformly
                          distributed in the range (0.0, 1.0) returned as
                          the value of the routine, and a 32-bit quantity
                          replacing the original value of the parameter.
                          See Chapter 1 for details on the internal
                          representation of real numbers.

HP FORTRAN 77/XL:         Callable as a system intrinsic:  Y = RAND(I)

Comments 

The parameter value for the initial call to RAND completely determines a
sequence of pseudo-random numbers.  Each time RAND returns a new value to
the calling program, it also sets a new 32-bit value in place of the
parameter.  To continue the pseudo-random sequence thus initiated, that
32-bit value must be used as the parameter in the next call to RAND.



MPE/iX 5.0 Documentation