Function: math-random-three-digit-number

math-random-three-digit-number is a byte-compiled function defined in calc-comb.el.gz.

Signature

(math-random-three-digit-number)

Documentation

Return a random three digit number.

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-comb.el.gz
(defun math-random-three-digit-number ()
  "Return a random three digit number."
  (let (i)
    (or (and (boundp 'var-RandSeed) (eq var-RandSeed math-last-RandSeed))
	(math-init-random-base))
    (or math-random-cache
	(progn
	  (setq math-random-last (math-random-base)
		math-random-cache (make-vector 13 nil)
		i -1)
	  (while (< (setq i (1+ i)) 13)
	    (aset math-random-cache i (math-random-base)))))
    (while (progn
	     (setq i (/ math-random-last 79)   ; 0 <= i < 13
		   math-random-last (aref math-random-cache i))
	     (aset math-random-cache i (math-random-base))
	     (>= math-random-last 1000)))
    math-random-last))