From: Taylor R Campbell Date: Fri, 14 Dec 2018 17:20:49 +0000 (+0000) Subject: Normalize significand in flo:random-unit-open even on 32-bit. X-Git-Tag: mit-scheme-pucked-10.1.9~3^2~35^2~10 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=27f2b5d57a31f04883c631412c9180b9a2584828;p=mit-scheme.git Normalize significand in flo:random-unit-open even on 32-bit. --- 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))