summaryrefslogtreecommitdiff
path: root/src/unitnumber.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2016-12-13 12:46:09 -0700
committerMike Buland <eichlan@xagasoft.com>2016-12-13 12:46:09 -0700
commit7e0edb6c2db17c87415fbd041ef7add9dfb467e5 (patch)
tree2feddf5d1dde80d97b2eefdd299cbebc0d2e30d4 /src/unitnumber.cpp
parent5d59aa3e9dffe2912215335ce0b76c67ebbe5a4e (diff)
downloadclic-7e0edb6c2db17c87415fbd041ef7add9dfb467e5.tar.gz
clic-7e0edb6c2db17c87415fbd041ef7add9dfb467e5.tar.bz2
clic-7e0edb6c2db17c87415fbd041ef7add9dfb467e5.tar.xz
clic-7e0edb6c2db17c87415fbd041ef7add9dfb467e5.zip
Corrected negation and single value parse bugs.
Discovered arithmetic bug in the Number class, -4 + 5 is coming back as -1, not 1. It's getting the sign wrong somehow. I'll have to hunt that down.
Diffstat (limited to '')
-rw-r--r--src/unitnumber.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/unitnumber.cpp b/src/unitnumber.cpp
index d213ed7..c316d4b 100644
--- a/src/unitnumber.cpp
+++ b/src/unitnumber.cpp
@@ -89,6 +89,10 @@ void UnitNumber::number1()
89 mathTest("1000902491523000321", *, "3004392012498000700", 89 mathTest("1000902491523000321", *, "3004392012498000700",
90 "3007103450821050020096034077958224700"); 90 "3007103450821050020096034077958224700");
91 91
92 mathTest("-4", -, "5", "-9");
93 mathTest("-4", -, "-5", "1");
94 mathTest("-4", +, "5", "1");
95 mathTest("5", +, "-4", "1");
92 mathTest("-872", +, "123", "-749"); 96 mathTest("-872", +, "123", "-749");
93 mathTest("728", +, "-51", "677"); 97 mathTest("728", +, "-51", "677");
94 mathTest("44", +, "-55", "-11"); 98 mathTest("44", +, "-55", "-11");