projects
/
mit-scheme.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a15c4d7
)
Normalize significand in flo:random-unit-open even on 32-bit.
author
Taylor R Campbell
<campbell@mumble.net>
Fri, 14 Dec 2018 17:20:49 +0000
(17:20 +0000)
committer
Taylor R Campbell
<campbell@mumble.net>
Sat, 15 Dec 2018 22:33:22 +0000
(22:33 +0000)
src/runtime/random.scm
patch
|
blob
|
history
diff --git
a/src/runtime/random.scm
b/src/runtime/random.scm
index 14be33598d03aaa1f16887066bc74f03530ea59c..81cb87b19a029825cd211599f665690b90ff2f94 100644
(file)
--- 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))