Examples of $RANDOM()

Example:

    GTM> FOR i=1:1:10 WRITE $RANDOM(1)
    0000000000
    GTM>
    

This shows that when $RANDOM() has an argument of one (1), the result is too confined to be random.

Example:

    SET x=$RANDOM(100)+1*.01
    

This $RANDOM() example produces a number between 0 and 99. The example then shifts with addition, and scales with multiplication to create a value between .01 and 1.