Fixed an error with post-simplified math

This commit is contained in:
John Wiegley 2009-10-27 17:30:34 -04:00
parent 3c30f74931
commit 12616dd030

View file

@ -658,7 +658,18 @@ value_t& value_t::operator/=(const value_t& val)
return *this;
case BALANCE:
if (val.as_balance().single_amount()) {
as_amount_lval() /= val.simplified().as_amount();
value_t simpler(val.simplified());
switch (simpler.type()) {
case INTEGER:
as_amount_lval() /= simpler.as_long();
break;
case AMOUNT:
as_amount_lval() /= simpler.as_amount();
break;
default:
assert(0);
break;
}
return *this;
}
break;