diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/number.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/number.cpp b/src/number.cpp index 81aefbe..93ddc0a 100644 --- a/src/number.cpp +++ b/src/number.cpp | |||
@@ -429,8 +429,9 @@ void Number::divide( const Number &rhs, Number &q, Number &r ) const | |||
429 | if( r.aFrac.getSize() != iScale ) | 429 | if( r.aFrac.getSize() != iScale ) |
430 | r.aFrac = PackedIntArray( aFrac.getBitWidth(), iScale ); | 430 | r.aFrac = PackedIntArray( aFrac.getBitWidth(), iScale ); |
431 | 431 | ||
432 | // The numerator is re-created every step to match the divisor and | 432 | // We seed the numerator with the bare minimum data that we potentially |
433 | // anchor | 433 | // need to actually divide. We need at least as many digits in the |
434 | // numerator segment as we have in the denominator. | ||
434 | Number nNum( iScale, iRadix ); | 435 | Number nNum( iScale, iRadix ); |
435 | for( int j = iAnchor-iNumShift; | 436 | for( int j = iAnchor-iNumShift; |
436 | nNum.aInt.getSize() < nDiv.aInt.getSize(); j++ ) | 437 | nNum.aInt.getSize() < nDiv.aInt.getSize(); j++ ) |