tests/mzscheme/common/src/random.mzscheme

;; END COMMENT
(define IM   139968)
(define IA     3877)
(define IC    29573)

(define LAST 42)
(define (gen_random max)
  (set! LAST (modulo (+ (* LAST IA) IC) IM))
  (/ (* max LAST) IM))

(define (main args)
  (let ((n (or (and (= (length args) 1) (string->number (car args))) 1)))
    (let loop ((iter n))
      (if (> iter 1)
	  (begin
	    (gen_random 100.0)
	    (loop (- iter 1)))))
    (display (format "~a\n" (gen_random 100.0)))))

Generated by GNU enscript 1.6.3.