From 7026b96ec807b169f7b413056e52412ae422ea9d Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 30 Oct 2014 13:15:19 -0600 Subject: The new division works great! Other minor bug fixes including scale issues, digit() access stopped a digit before the final possible digit in the scale, >, >=, <, <= all work correctly with mixed scale numbers now, probably other fixes. --- src/unitnumber.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/unitnumber.cpp') diff --git a/src/unitnumber.cpp b/src/unitnumber.cpp index 1d63682..4846a07 100644 --- a/src/unitnumber.cpp +++ b/src/unitnumber.cpp @@ -15,6 +15,8 @@ UnitNumber::UnitNumber() "parse1", Bu::UnitSuite::expectPass ); add( static_cast(&UnitNumber::multiply1), "multiply1", Bu::UnitSuite::expectPass ); + add( static_cast(&UnitNumber::divide1), + "divide1", Bu::UnitSuite::expectPass ); add( static_cast(&UnitNumber::number1), "number1", Bu::UnitSuite::expectPass ); add( static_cast(&UnitNumber::compare1), @@ -68,6 +70,12 @@ void UnitNumber::multiply1() ); } +void UnitNumber::divide1() +{ + unitTest(Number("4") / Number("10") == "0"); + unitTest(Number("4") % Number("10") == "4"); +} + #define mathTest( anum, op, bnum, answ ) \ unitTest( (Number(anum) op Number(bnum)).toString() == answ ) -- cgit v1.2.3