From 95ace7dc598be3912feb0fa2f5fedb59d9ee0368 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 14 Nov 2013 15:36:21 -0700 Subject: Working on new division code. It's not better yet, but it almost works. --- src/unitnumber.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/unitnumber.cpp') diff --git a/src/unitnumber.cpp b/src/unitnumber.cpp index 92cf1b7..fc56bf6 100644 --- a/src/unitnumber.cpp +++ b/src/unitnumber.cpp @@ -252,6 +252,8 @@ void UnitNumber::radix1() #define mathTestS( sc, anum, op, bnum, answ ) \ unitTest( (Number(anum, sc) op Number(bnum, sc)).toString() == answ ) +#define mathTestP( sc, anum, op, bnum, answ ) \ + Bu::println(">>%1<<").arg((Number(anum, sc) op Number(bnum, sc)).toString()) void UnitNumber::fraction1() { @@ -261,7 +263,9 @@ void UnitNumber::fraction1() mathTestS( 8, "123.456", -, "0.987", "122.469" ); mathTestS( 8, "123.456", *, "0.987", "121.851072" ); mathTestS( 8, "123.456", /, "0.987", "125.08206686" ); - + + mathTestP( 5, "63.6", /, "504", "0.12619" ); + mathTestS( 5, "63.6", /, "504", "0.12619" ); mathTestS( 8, "12", /, "4", "3" ); mathTestS( 100, "9", /, "1.9", "4.7368421052631578947368421052631578947368421052631578947368421052631578947368421052631578947368421052" ); } -- cgit v1.2.3