diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux/math.lux | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/stdlib/source/test/lux/math.lux b/stdlib/source/test/lux/math.lux index ffe990c50..17ed2086c 100644 --- a/stdlib/source/test/lux/math.lux +++ b/stdlib/source/test/lux/math.lux @@ -7,6 +7,7 @@ [data ["." bit ("#@." equivalence)] [number + ["n" nat] ["." int] ["f" frac]]]] {1 @@ -71,21 +72,21 @@ (|> sample /.exp /.log (within? +0.000000000000001 sample))))) (<| (_.context "Greatest-Common-Divisor and Least-Common-Multiple") (do r.monad - [#let [gen-nat (|> r.nat (:: @ map (|>> (n/% 1000) (n/max 1))))] + [#let [gen-nat (|> r.nat (:: @ map (|>> (n.% 1000) (n.max 1))))] x gen-nat y gen-nat] ($_ _.and (_.test "GCD" - (let [gcd (/.n/gcd x y)] - (and (n/= 0 (n/% gcd x)) - (n/= 0 (n/% gcd y)) - (n/>= 1 gcd)))) + (let [gcd (n.gcd x y)] + (and (n.= 0 (n.% gcd x)) + (n.= 0 (n.% gcd y)) + (n.>= 1 gcd)))) (_.test "LCM" - (let [lcm (/.n/lcm x y)] - (and (n/= 0 (n/% x lcm)) - (n/= 0 (n/% y lcm)) - (n/<= (n/* x y) lcm)))) + (let [lcm (n.lcm x y)] + (and (n.= 0 (n.% x lcm)) + (n.= 0 (n.% y lcm)) + (n.<= (n.* x y) lcm)))) ))) /infix.test |