Sometimes generate random integers.
original commit: ca2e6bd769374b2e636fdf0a59afda484fb7975a
This commit is contained in:
parent
b78a21ce68
commit
4da3453cf5
|
@ -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)]))
|
||||
|
|
Loading…
Reference in New Issue
Block a user