aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorEduardo Julian2018-05-08 23:12:05 -0400
committerEduardo Julian2018-05-08 23:12:05 -0400
commit3fc3b81cf1b2329b256352cef0a02e7535f8307b (patch)
treec7b8c590b488284a98f64a870e6ee6a9c6ad5c2a /stdlib
parent3b80f40384a8af8770a7c4f1be8b334ceb950a27 (diff)
- Improved random-generation of Frac numbers.
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/math/random.lux9
1 files changed, 1 insertions, 8 deletions
diff --git a/stdlib/source/lux/math/random.lux b/stdlib/source/lux/math/random.lux
index 695323c98..e90c3eb6d 100644
--- a/stdlib/source/lux/math/random.lux
+++ b/stdlib/source/lux/math/random.lux
@@ -90,14 +90,7 @@
(def: #export frac
(Random Frac)
- (do Monad<Random>
- [left (bits +26)
- right (bits +27)]
- (wrap (|> right
- (n/+ (bit.left-shift +27 left))
- nat-to-int
- int-to-frac
- (f// (|> +1 (bit.left-shift +53) nat-to-int int-to-frac))))))
+ (:: Monad<Random> map number.bits-to-frac nat))
(def: #export deg
(Random Deg)