From c0d40b3cd080214c9995271ff1352d6d5767ffd4 Mon Sep 17 00:00:00 2001 From: Arthur Drobot Date: Tue, 8 Aug 2017 09:27:10 -0700 Subject: [PATCH] Adjust unit tests. Set the number of significant figures in the output to 50. --- src/main/java/org/nwapw/abacus/number/PreciseNumber.java | 2 +- src/test/java/org/nwapw/abacus/tests/CalculationTests.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 src/test/java/org/nwapw/abacus/tests/CalculationTests.java diff --git a/src/main/java/org/nwapw/abacus/number/PreciseNumber.java b/src/main/java/org/nwapw/abacus/number/PreciseNumber.java index e3af94f..094e5a9 100755 --- a/src/main/java/org/nwapw/abacus/number/PreciseNumber.java +++ b/src/main/java/org/nwapw/abacus/number/PreciseNumber.java @@ -30,7 +30,7 @@ public class PreciseNumber extends NumberInterface { /** * MathContext that is used when rounding a number prior to output. */ - private static MathContext outputContext = new MathContext(30); + private static MathContext outputContext = new MathContext(50); /** * MathContext that is actually used in calculations. diff --git a/src/test/java/org/nwapw/abacus/tests/CalculationTests.java b/src/test/java/org/nwapw/abacus/tests/CalculationTests.java old mode 100644 new mode 100755 index e451732..dbf0bc7 --- a/src/test/java/org/nwapw/abacus/tests/CalculationTests.java +++ b/src/test/java/org/nwapw/abacus/tests/CalculationTests.java @@ -88,8 +88,8 @@ public class CalculationTests { public void testExp(){ testOutput("exp0", "exp(0)", "1"); testOutput("exp1", "exp(1)", "2.718281828459045235360287471352662497757247"); - testOutput("exp300", "exp(300)", "19424263952412559365842088360176992193662086"); - testOutput("exp300", "exp(300)", "19424263952412559365842088360176992193662086"); + testOutput("exp300", "exp(300)", "1.9424263952412559365842088360176992193662086"); + testOutput("exp(-500)", "exp((500)`)", "7.1245764067412855315491573771227552469277568"); } @Test