Skip to content
Snippets Groups Projects
Commit 2b358d4a authored by pfdietz's avatar pfdietz
Browse files

Modify how integer types are generated so we have a high probability of seeing...

Modify how integer types are generated so we have a high probability of seeing types where the upper and lower bounds are 'close' in magnitude.
parent 5e40cdf6
No related branches found
No related tags found
No related merge requests found
...@@ -115,11 +115,17 @@ ...@@ -115,11 +115,17 @@
"Generate a list (LO HI) of integers, LO <= HI. This is used "Generate a list (LO HI) of integers, LO <= HI. This is used
for generating integer types." for generating integer types."
(declare (ignore var)) (declare (ignore var))
(flet ((%r () (let ((r (ash 1 (1+ (random *maximum-random-int-bits*))))) (rcase
(- (random r) (floor (/ r 2)))))) (1 (flet ((%r () (let ((r (ash 1 (1+ (random *maximum-random-int-bits*)))))
(let ((x (%r)) (- (random r) (floor (/ r 2))))))
(y (%r))) (let ((x (%r))
(list (min x y) (max x y))))) (y (%r)))
(list (min x y) (max x y)))))
(1 (let* ((b (ash 1 (1+ (random *maximum-random-int-bits*))))
(b2 (floor (/ b 2))))
(let ((x (- (random b) b2))
(y (- (random b) b2)))
(list (min x y) (max x y)))))))
(defparameter *flet-names* nil) (defparameter *flet-names* nil)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment