The 'random' function generates and returns a random number between 0 and
(random 100) ; returns 7 (random 100) ; returns 49 (random 100) ; returns 73 (random -100) ; returns 58 (random 100.01) ; error: bad floating point operation
Common Lisp: Common Lisp allows an optional 'state' parameter, which is not supported in XLISP. Also, Common LISP allows floating point numbers, which XLISP does not support.
Note: This function is an extension of the XLISP system. It is provided in the 'msstuff.c' source code file. If your XLISP system is built for an IBM PC and compatibles, this function will work. If your system is built on UNIX or some other operating system, it will need the code in the corresponding 'stuff.c' file.
Nyquist: As far as I know the Nyquist 'random' function works on all systems. See also the Nyquist rrandom function.
See the
random
function in the