Returns a random integer from a range specified by its argument.

The format for the $RANDOM function is:

$R[ANDOM](intexpr)

$RANDOM() provides a tool for generating pseudo-random patterns useful in testing or statistical calculations. $RANDOM() results fall between zero (0) and one less than the argument.

Random number generators use factors from the environment to create sequences of numbers. True random number generation requires a source of what is known as "noise". Pseudo-random numbers appear to have no pattern, but are developed using interactions between factors that vary in ways not guaranteed to be entirely random. In accordance with the M standard, the GT.M implementation of $RANDOM() produces pseudo-random numbers.

loading table of contents...