summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/amount.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/amount.cc b/src/amount.cc
index 70ffd603..a6c1eb35 100644
--- a/src/amount.cc
+++ b/src/amount.cc
@@ -507,11 +507,12 @@ void amount_t::in_place_unreduce()
bool shifted = false;
while (comm && comm->larger()) {
- temp /= comm->larger()->number();
- if (temp.abs() < amount_t(1L))
+ amount_t next_temp = temp / comm->larger()->number();
+ if (next_temp.abs() < amount_t(1L))
break;
- shifted = true;
+ temp = next_temp;
comm = comm->larger()->commodity_;
+ shifted = true;
}
if (shifted) {