next | previous | forward | backward | up | top | index | toc | home

random(ZZ) -- random integer

Synopsis

Description

Here is a basic example:
i1 : random 57

o1 = 12
Here is an example using the tally command.
i2 : tally apply(100, i -> random 10)

o2 = Tally{0 => 10}
           1 => 13
           2 => 9
           3 => 11
           4 => 11
           5 => 7
           6 => 15
           7 => 8
           8 => 8
           9 => 8

o2 : Tally

Caveat

doesn't correctly handle the case when n an integer is larger than 2^31-1.

See also