Fixed an error with post-simplified math
This commit is contained in:
parent
3c30f74931
commit
12616dd030
1 changed files with 12 additions and 1 deletions
13
src/value.cc
13
src/value.cc
|
|
@ -658,7 +658,18 @@ value_t& value_t::operator/=(const value_t& val)
|
||||||
return *this;
|
return *this;
|
||||||
case BALANCE:
|
case BALANCE:
|
||||||
if (val.as_balance().single_amount()) {
|
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;
|
return *this;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue