Sometimes generate random integers.

original commit: ca2e6bd769374b2e636fdf0a59afda484fb7975a
This commit is contained in:
Vincent St-Amour 2013-03-19 15:01:54 -04:00
parent b78a21ce68
commit 4da3453cf5

View File

@ -110,7 +110,7 @@
(define (random-integer->random-real E)
(define r (random))
;; probability 0.25 each
(cond [(r . < . 0.25) r]
(cond [(r . < . 0.25) E]
[(r . < . 0.50) (random-integer->random-exact-rational E)]
[(r . < . 0.75) (random-integer->random-flonum E)]
[else (random-integer->random-single-flonum E)]))