changes
This commit is contained in:
parent
074533f006
commit
705ce8c6a1
1 changed files with 0 additions and 17 deletions
17
amount.cc
17
amount.cc
|
|
@ -632,23 +632,6 @@ amount_t& amount_t::operator/=(const amount_t& amt)
|
|||
goto finish;
|
||||
}
|
||||
|
||||
if (has_commodity() && amt.has_commodity() &&
|
||||
commodity() != amt.commodity()) {
|
||||
throw new amount_error
|
||||
(std::string("Dividing amounts with different commodities: ") +
|
||||
(has_commodity() ? commodity_->qualified_symbol : "NONE") + " != " +
|
||||
(amt.has_commodity() ? amt.commodity_->qualified_symbol : "NONE"));
|
||||
}
|
||||
|
||||
if (! amt.quantity || ! amt) {
|
||||
throw new amount_error("Divide by zero");
|
||||
}
|
||||
else if (! quantity) {
|
||||
*this = amt;
|
||||
*this = *this - *this; // preserve the foreign commodity
|
||||
goto finish;
|
||||
}
|
||||
|
||||
_dup();
|
||||
|
||||
// Increase the value's precision, to capture fractional parts after
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue