
ANSI Common Lisp 12 Numbers 12.2 Dictionary of Numbers
 Syntax:

random
limit &optional randomstate
randomnumber
 Arguments and Values:

limit  a positive integer,
or a positive float.
randomstate  a random state.
The default is the current random state.
randomnumber  a nonnegative number
less than limit
and of the same type as limit.
 Description:

Returns a pseudorandom number that is a nonnegative number
less than limit and of the same type as limit.
The randomstate, which is modified by this function,
encodes the internal state maintained by the random number generator.
An approximately uniform choice distribution is used. If limit
is an integer, each of the possible results occurs with
(approximate) probability 1/limit.
 Examples:

(<= 0 (random 1000) 1000) true
(let ((state1 (makerandomstate))
(state2 (makerandomstate)))
(= (random 1000 state1) (random 1000 state2))) true
 Side Effects:

The randomstate is modified.
 Exceptional Situations:

Should signal an error of type typeerror if limit is not a positive integer or a positive real.
 See Also:

makerandomstate, *randomstate*
 Notes:

See Common Lisp: The Language for information about generating random numbers.
 Allegro CL Implementation Details:

See cl:random and cl:makerandomstate for information on the Allegro CL implementation of random. Note
the links are to the documentation for the current Allegro CL
version. Replace /current/ in the URL with the Allegro CL version
number to see similar documentation is earlier releases.
