aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/math.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/lux/math.lux9
1 files changed, 2 insertions, 7 deletions
diff --git a/stdlib/source/test/lux/math.lux b/stdlib/source/test/lux/math.lux
index a8c7c121e..a140a736d 100644
--- a/stdlib/source/test/lux/math.lux
+++ b/stdlib/source/test/lux/math.lux
@@ -21,17 +21,12 @@
["#/." continuous]
["#/." fuzzy]]])
-(def: (within? margin_of_error standard value)
- (-> Frac Frac Frac Bit)
- (f.< margin_of_error
- (f.abs (f.- standard value))))
-
(def: margin Frac +0.0000001)
(def: (trigonometric_symmetry forward backward angle)
(-> (-> Frac Frac) (-> Frac Frac) Frac Bit)
(let [normal (|> angle forward backward)]
- (|> normal forward backward (within? margin normal))))
+ (|> normal forward backward (f.approximately? margin normal))))
(def: #export test
Test
@@ -71,7 +66,7 @@
(do {! random.monad}
[sample (|> random.safe_frac (\ ! map (f.* +10.0)))]
(_.test "Logarithm is the inverse of exponential."
- (|> sample /.exp /.log (within? +0.000000000000001 sample)))))
+ (|> sample /.exp /.log (f.approximately? +0.000000000000001 sample)))))
(<| (_.context "Greatest-Common-Divisor and Least-Common-Multiple")
(do {! random.monad}
[#let [gen_nat (|> random.nat (\ ! map (|>> (n.% 1000) (n.max 1))))]