Programming

(emacs lisp) random

steloflute 2012. 8. 11. 21:44

http://www.gnu.org/software/emacs/manual/html_node/elisp/Random-Numbers.html


— Function: random &optional limit

This function returns a pseudo-random integer. Repeated calls return a series of pseudo-random integers.

If limit is a positive integer, the value is chosen to be nonnegative and less than limit.

If limit is t, it means to choose a new seed based on the current time of day and on Emacs's process ID number.

On some machines, any integer representable in Lisp may be the result of random. On other machines, the result can never be larger than a certain maximum or less than a certain (negative) minimum.