Generates a random number.
(rand a) is equivalent to
(rand 0 a).
(rand a b) generates a random number between
If both arguments are integers, then
ais an inclusive bound and
bis an exclusive bound, and the result will be an integer.
If either argument is a float, then both bounds are inclusive and the result will be a float.
There is no requirement for
b to be greater than
a. For example,
(rand -3) may
(rand 5 3) may return
The built-in random number generator uses a simple linear-congruential algorithm. It may not be appropriate when high-quality randomness is required.