diff options
author | Mike Buland <mike@xagasoft.com> | 2013-11-14 15:36:21 -0700 |
---|---|---|
committer | Mike Buland <mike@xagasoft.com> | 2013-11-14 15:36:21 -0700 |
commit | 95ace7dc598be3912feb0fa2f5fedb59d9ee0368 (patch) | |
tree | 42a92d71a22ed40397b41301fbfb71173c6e6334 /src/unitnumber.cpp | |
parent | abe7e449143052b07fae688da690c2a7d387a291 (diff) | |
download | clic-95ace7dc598be3912feb0fa2f5fedb59d9ee0368.tar.gz clic-95ace7dc598be3912feb0fa2f5fedb59d9ee0368.tar.bz2 clic-95ace7dc598be3912feb0fa2f5fedb59d9ee0368.tar.xz clic-95ace7dc598be3912feb0fa2f5fedb59d9ee0368.zip |
Working on new division code.newdiv
It's not better yet, but it almost works.
Diffstat (limited to '')
-rw-r--r-- | src/unitnumber.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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() | |||
252 | 252 | ||
253 | #define mathTestS( sc, anum, op, bnum, answ ) \ | 253 | #define mathTestS( sc, anum, op, bnum, answ ) \ |
254 | unitTest( (Number(anum, sc) op Number(bnum, sc)).toString() == answ ) | 254 | unitTest( (Number(anum, sc) op Number(bnum, sc)).toString() == answ ) |
255 | #define mathTestP( sc, anum, op, bnum, answ ) \ | ||
256 | Bu::println(">>%1<<").arg((Number(anum, sc) op Number(bnum, sc)).toString()) | ||
255 | 257 | ||
256 | void UnitNumber::fraction1() | 258 | void UnitNumber::fraction1() |
257 | { | 259 | { |
@@ -261,7 +263,9 @@ void UnitNumber::fraction1() | |||
261 | mathTestS( 8, "123.456", -, "0.987", "122.469" ); | 263 | mathTestS( 8, "123.456", -, "0.987", "122.469" ); |
262 | mathTestS( 8, "123.456", *, "0.987", "121.851072" ); | 264 | mathTestS( 8, "123.456", *, "0.987", "121.851072" ); |
263 | mathTestS( 8, "123.456", /, "0.987", "125.08206686" ); | 265 | mathTestS( 8, "123.456", /, "0.987", "125.08206686" ); |
264 | 266 | ||
267 | mathTestP( 5, "63.6", /, "504", "0.12619" ); | ||
268 | mathTestS( 5, "63.6", /, "504", "0.12619" ); | ||
265 | mathTestS( 8, "12", /, "4", "3" ); | 269 | mathTestS( 8, "12", /, "4", "3" ); |
266 | mathTestS( 100, "9", /, "1.9", "4.7368421052631578947368421052631578947368421052631578947368421052631578947368421052631578947368421052" ); | 270 | mathTestS( 100, "9", /, "1.9", "4.7368421052631578947368421052631578947368421052631578947368421052631578947368421052631578947368421052" ); |
267 | } | 271 | } |