SYNOPSIS<rand $min $max>
DESCRIPTION
The rand
function returns a pseudo-random integer n
between
$min
and $max
. The pseudo-random number generator used
is the system rand()
or random()
C function, and is seeded
by srand
(here). If srand
has not been
explicitly called before the first use of rand
, srand
with an empty argument is called first.
DIAGNOSTICSrand
returns a pseudo-random integer n
, $min
<= n < $max
.
EXAMPLE<rand 0 100>
Your test score is $ret%.
The output might be:
Your test score is 42%.
CAVEATS
The rand
function was added Nov. 7 1996.
Although seeded, the randomness of numbers generated by rand
may vary by platform.