Next: , Previous: , Up: Numbers   [Contents][Index]

5.4.10 Pseudo-Random Numbers

The random function allows pseudo-random numbers to be generated.

Function: random #!optional limit

Return a pseudo-random number between zero and limit-1 inclusive. If limit is undefined, it is taken as being the largest positive integer representable in a fixnum.

Calling random with limit equal to the symbol t seeds the generator with the current time of day.