From 27f2b5d57a31f04883c631412c9180b9a2584828 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Fri, 14 Dec 2018 17:20:49 +0000 Subject: [PATCH] Normalize significand in flo:random-unit-open even on 32-bit. --- src/runtime/random.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runtime/random.scm b/src/runtime/random.scm index 14be33598..81cb87b19 100644 --- a/src/runtime/random.scm +++ b/src/runtime/random.scm @@ -453,7 +453,8 @@ USA. (let ((s0 (int:->flonum (%random-16 state))) (s1 (int:->flonum (%random-16 state))) (s2 (int:->flonum (%random-16 state))) - (s3 (int:->flonum (fix:and (%random-16 state) #xf)))) + (s3 + (int:->flonum (fix:or #x10 (fix:and (%random-16 state) #xf))))) (let ((lo (flo:+ (flo:* 65536. s1) s0)) (hi (flo:+ (flo:* 65536. s3) s2))) (declare (integrate lo hi)) -- 2.25.1