diff options
Diffstat (limited to '')
-rw-r--r-- | src/number.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/number.cpp b/src/number.cpp index 15cad95..f9fab26 100644 --- a/src/number.cpp +++ b/src/number.cpp | |||
@@ -248,6 +248,8 @@ void Number::set( const Bu::String &sNum ) | |||
248 | aInt.clear(); | 248 | aInt.clear(); |
249 | aFrac.zero(); | 249 | aFrac.zero(); |
250 | bPositive = true; | 250 | bPositive = true; |
251 | if( sNum.isEmpty() ) | ||
252 | return; | ||
251 | int iPt; | 253 | int iPt; |
252 | for( iPt = 0; iPt < sNum.getSize() && sNum[iPt] != '.'; iPt++ ) { } | 254 | for( iPt = 0; iPt < sNum.getSize() && sNum[iPt] != '.'; iPt++ ) { } |
253 | 255 | ||
@@ -455,7 +457,7 @@ void Number::divide( const Number &rhs, Number &q, Number &r ) const | |||
455 | newrhs.aInt.append( rhs.digit( j ) ); | 457 | newrhs.aInt.append( rhs.digit( j ) ); |
456 | newbase.aInt.append( digit( j ) ); | 458 | newbase.aInt.append( digit( j ) ); |
457 | } | 459 | } |
458 | for( int j = 0; j < aInt.getSize(); j++ ) | 460 | for( int j = rhs.aInt.getSize(); j < aInt.getSize(); j++ ) |
459 | { | 461 | { |
460 | newbase.aInt.append( aInt.get( j ) ); | 462 | newbase.aInt.append( aInt.get( j ) ); |
461 | } | 463 | } |