From 9ff1c394dbf65f98adb6e183e576dee739f3d596 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 29 Jan 2017 11:42:16 -0400 Subject: - Some refactorings and small expansions to lux/math. --- stdlib/test/test/lux/math.lux | 4 ++-- stdlib/test/test/lux/math/complex.lux | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'stdlib/test') 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))) -- cgit v1.2.3