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.lux11
1 files changed, 11 insertions, 0 deletions
diff --git a/stdlib/source/test/lux/math.lux b/stdlib/source/test/lux/math.lux
index a43d63a2b..db314f400 100644
--- a/stdlib/source/test/lux/math.lux
+++ b/stdlib/source/test/lux/math.lux
@@ -77,6 +77,17 @@
(let [round'd (/.round sample)]
(and (|> round'd f.int i.frac (f.= round'd))
(f.<= +1.0 (f.abs (f.- sample round'd))))))
+ (_.cover [/.root/2]
+ (let [sample (f.abs sample)]
+ (|> sample
+ /.root/2
+ (/.pow +2.0)
+ (f.approximately? ..margin_of_error sample))))
+ (_.cover [/.root/3]
+ (|> sample
+ /.root/3
+ (/.pow +3.0)
+ (f.approximately? ..margin_of_error sample)))
))
(do {! random.monad}
[#let [~= (f.approximately? ..margin_of_error)]