chickadee » srfi-216 » random

random xprocedure

Returns a nonnegative number less than its input. If random is given an exact integer, it returns an exact integer, but if it is given a decimal value, it returns a decimal value. If x is less than 0, the behaviour is unspecified. See Section 1.2.6 of the SICP, Subsection "Fermat Test", and Exercise 3.5, footnote 8.

Example:

(import (srfi 216))
(random 11)
;; prints 1