Skip to content

Commit

Permalink
Avoid a type-check in RANDOM for floats.
Browse files Browse the repository at this point in the history
  • Loading branch information
stassats committed Jul 10, 2024
1 parent b44e328 commit c9a6ac2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/code/target-random.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
while (#+x86 eql ;; Can't use = due to 80-bit precision
#-x86 =
candidate arg)
finally (return candidate)))
finally (return (truly-the (single-float 0.0) candidate))))
(declaim (ftype (function ((double-float (0d0)) random-state)
(double-float 0d0))
%random-double-float))
Expand All @@ -353,7 +353,7 @@ http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
(random-chunk state))
1d0))
while (= candidate arg)
finally (return candidate)))
finally (return (truly-the (double-float 0d0) candidate))))

;;; using a faster inline VOP
#+x86
Expand All @@ -373,7 +373,7 @@ http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
1d0))
;; Can't use = due to 80-bit precision
while (eql candidate arg)
finally (return candidate))))
finally (return (truly-the (double-float 0d0) candidate)))))


;;;; random fixnums
Expand Down

0 comments on commit c9a6ac2

Please sign in to comment.