Skip to content
Snippets Groups Projects
Commit 395af224 authored by Raymond Toy's avatar Raymond Toy
Browse files

RANDOM should do the same as the deftransform would do.

Make RANDOM compute the value the same way as the deftransform would
do when the arg is a 32-bit integer.

The deftransform is still currently disabled for random-xoroshiro,
though.
parent fb3f58ea
No related branches found
No related tags found
No related merge requests found
...@@ -474,8 +474,11 @@ ...@@ -474,8 +474,11 @@
(declare (inline %random-single-float %random-double-float)) (declare (inline %random-single-float %random-double-float))
(cond (cond
((typep arg '(integer 1 #x100000000)) ((typep arg '(integer 1 #x100000000))
;; Let the compiler deftransform take care of this case. ;; Do the same thing as the deftransform would do.
(%random-integer arg state)) (if (= arg (expt 2 32))
(random-chunk state)
(values (bignum::%multiply (random-chunk state)
arg))))
((and (typep arg 'single-float) (> arg 0.0F0)) ((and (typep arg 'single-float) (> arg 0.0F0))
(%random-single-float arg state)) (%random-single-float arg state))
((and (typep arg 'double-float) (> arg 0.0D0)) ((and (typep arg 'double-float) (> arg 0.0D0))
......
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