summaryrefslogtreecommitdiff
path: root/src/number.cpp
diff options
context:
space:
mode:
authorMike Buland <mike@xagasoft.com>2014-11-28 13:45:37 -0700
committerMike Buland <mike@xagasoft.com>2014-11-28 13:45:37 -0700
commit9f7cbe624a91008a4cbe47c7b369c5e3f96a4eff (patch)
tree561bd5cb20d17c0c5e5289763d140e42cdde8a3f /src/number.cpp
parent02573826558bd44f0ec3ed542964be0096d5e389 (diff)
downloadclic-9f7cbe624a91008a4cbe47c7b369c5e3f96a4eff.tar.gz
clic-9f7cbe624a91008a4cbe47c7b369c5e3f96a4eff.tar.bz2
clic-9f7cbe624a91008a4cbe47c7b369c5e3f96a4eff.tar.xz
clic-9f7cbe624a91008a4cbe47c7b369c5e3f96a4eff.zip
Division fixes, better config, more tests.0.11
Other minor fixes and options such as --version being added.
Diffstat (limited to '')
-rw-r--r--src/number.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/number.cpp b/src/number.cpp
index 8fc1d7f..05e310c 100644
--- a/src/number.cpp
+++ b/src/number.cpp
@@ -434,6 +434,7 @@ void Number::divide( const Number &rhs, Number &q, Number &r ) const
434 DBS( DIVIDE, Bu::println(" -> '%1'").arg( rhs.digit( j ) ) ); 434 DBS( DIVIDE, Bu::println(" -> '%1'").arg( rhs.digit( j ) ) );
435 nDiv.aInt.append( rhs.digit( j ) ); 435 nDiv.aInt.append( rhs.digit( j ) );
436 } 436 }
437 nDiv.aInt.trim();
437 DBS( DIVIDE, Bu::println("New divisor: %1").arg( nDiv ) ); 438 DBS( DIVIDE, Bu::println("New divisor: %1").arg( nDiv ) );
438 439
439 // Anchor is the position in the output the new digit will appear. 440 // Anchor is the position in the output the new digit will appear.
@@ -463,6 +464,7 @@ void Number::divide( const Number &rhs, Number &q, Number &r ) const
463 DBS( DIVIDE, Bu::println(" ->[%1] '%2'").arg( j ).arg( digit(j) ) ); 464 DBS( DIVIDE, Bu::println(" ->[%1] '%2'").arg( j ).arg( digit(j) ) );
464 nNum.aInt.append( digit( j ) ); 465 nNum.aInt.append( digit( j ) );
465 } 466 }
467 nNum.aInt.trim();
466 DBS( DIVIDE, Bu::println("New numerator: %1").arg( nNum ) ); 468 DBS( DIVIDE, Bu::println("New numerator: %1").arg( nNum ) );
467 while( iAnchor >= -iScale && (!nNum.isZero() || iAnchor > 0)) // division loop 469 while( iAnchor >= -iScale && (!nNum.isZero() || iAnchor > 0)) // division loop
468 { 470 {