aboutsummaryrefslogtreecommitdiff
path: root/stdlib/test
diff options
context:
space:
mode:
authorEduardo Julian2017-01-29 11:42:16 -0400
committerEduardo Julian2017-01-29 11:42:16 -0400
commit9ff1c394dbf65f98adb6e183e576dee739f3d596 (patch)
tree99e72b372f69bf0e5bc62891b705217513c922ce /stdlib/test
parent97329ec45dd93dc1008d3778c6173fdfbfbd7ab8 (diff)
- Some refactorings and small expansions to lux/math.
Diffstat (limited to 'stdlib/test')
-rw-r--r--stdlib/test/test/lux/math.lux4
-rw-r--r--stdlib/test/test/lux/math/complex.lux6
2 files changed, 5 insertions, 5 deletions
diff --git a/stdlib/test/test/lux/math.lux b/stdlib/test/test/lux/math.lux
index 7ed31bdb4..18cb1545c 100644
--- a/stdlib/test/test/lux/math.lux
+++ b/stdlib/test/test/lux/math.lux
@@ -48,10 +48,10 @@
base (|> R;real (:: @ map (r.* factor)))]
($_ seq
(assert "Square-root is inverse of square."
- (|> base (&;pow 2.0) &;sqrt (r.= base)))
+ (|> base (&;pow 2.0) &;root2 (r.= base)))
(assert "Cubic-root is inverse of cube."
- (|> base (&;pow 3.0) &;cbrt (r.= base)))
+ (|> base (&;pow 3.0) &;root3 (r.= base)))
))
(test: "Rounding"
diff --git a/stdlib/test/test/lux/math/complex.lux b/stdlib/test/test/lux/math/complex.lux
index 9fba68dc9..04ebcb3c0 100644
--- a/stdlib/test/test/lux/math/complex.lux
+++ b/stdlib/test/test/lux/math/complex.lux
@@ -138,11 +138,11 @@
(assert "x*(x^-1) = 1"
(|> x (&;c.* (&;reciprocal x)) (within? margin-of-error &;one)))
- (assert "Absolute value of signum is always sqrt(2), 1 or 0."
+ (assert "Absolute value of signum is always root2(2), 1 or 0."
(let [signum-abs (|> x &;c.signum &;c.abs (get@ #&;real))]
(or (r.= 0.0 signum-abs)
(r.= 1.0 signum-abs)
- (r.= (math;sqrt 2.0) signum-abs))))
+ (r.= (math;root2 2.0) signum-abs))))
(assert "Negation is its own inverse."
(let [there (&;c.negate x)
@@ -173,7 +173,7 @@
[x gen-complex]
($_ seq
(assert "Square root is inverse of power 2.0"
- (|> x (&;pow' 2.0) &;sqrt (within? margin-of-error x)))
+ (|> x (&;pow' 2.0) &;root2 (within? margin-of-error x)))
(assert "Logarithm is inverse of exponentiation."
(|> x &;log &;exp (within? margin-of-error x)))