diff options
author | Mike Buland <mike@xagasoft.com> | 2014-11-24 15:51:08 -0700 |
---|---|---|
committer | Mike Buland <mike@xagasoft.com> | 2014-11-24 15:51:08 -0700 |
commit | 3320e1496b1d099f63dea869f4a1cc19630dc3a9 (patch) | |
tree | c56f8262951481376122650e9bc1c49358e304f1 /src/number.cpp | |
parent | f2f92156531b49da71067336ef0724f411226644 (diff) | |
download | clic-3320e1496b1d099f63dea869f4a1cc19630dc3a9.tar.gz clic-3320e1496b1d099f63dea869f4a1cc19630dc3a9.tar.bz2 clic-3320e1496b1d099f63dea869f4a1cc19630dc3a9.tar.xz clic-3320e1496b1d099f63dea869f4a1cc19630dc3a9.zip |
Fixed an annoying parsing bug.0.10
Diffstat (limited to 'src/number.cpp')
-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 0f99792..8fc1d7f 100644 --- a/src/number.cpp +++ b/src/number.cpp | |||
@@ -407,6 +407,8 @@ void Number::divide( const Number &rhs, Number &q, Number &r ) const | |||
407 | if( rhs.isZero() ) | 407 | if( rhs.isZero() ) |
408 | { | 408 | { |
409 | q = rhs; | 409 | q = rhs; |
410 | // This should be infinity (or negative infinity?) | ||
411 | // but we don't support that yet. Still have to figure that bit out. | ||
410 | r.set( 0 ); | 412 | r.set( 0 ); |
411 | return; | 413 | return; |
412 | } | 414 | } |
@@ -416,6 +418,7 @@ void Number::divide( const Number &rhs, Number &q, Number &r ) const | |||
416 | r.set( 0 ); | 418 | r.set( 0 ); |
417 | return; | 419 | return; |
418 | } | 420 | } |
421 | |||
419 | DBS( DIVIDE, Bu::println("divide: %1 / %2").arg( *this ).arg( rhs ) ); | 422 | DBS( DIVIDE, Bu::println("divide: %1 / %2").arg( *this ).arg( rhs ) ); |
420 | 423 | ||
421 | // iNumShift is how many digits we've shifted the entire equation, | 424 | // iNumShift is how many digits we've shifted the entire equation, |
@@ -532,7 +535,6 @@ void Number::divide( const Number &rhs, Number &q, Number &r ) const | |||
532 | DBS( DIVIDE, Bu::println("Quotient: %1").arg( q ) ); | 535 | DBS( DIVIDE, Bu::println("Quotient: %1").arg( q ) ); |
533 | DBS( DIVIDE, Bu::println("Final numerator? %1").arg( nNum ) ); | 536 | DBS( DIVIDE, Bu::println("Final numerator? %1").arg( nNum ) ); |
534 | DBS( DIVIDE, Bu::println("Remainder? %1").arg( r ) ); | 537 | DBS( DIVIDE, Bu::println("Remainder? %1").arg( r ) ); |
535 | |||
536 | } | 538 | } |
537 | 539 | ||
538 | bool Number::isZero() const | 540 | bool Number::isZero() const |