Permalink
Browse files

Don't attempt to invert a value if it's already zero (#1703)

  • Loading branch information...
jwiegley committed Jan 12, 2019
1 parent 863cb3b commit 56025cdefc07e30b025c65146affc141888b2f83
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/amount.cc
@@ -604,7 +604,9 @@ void amount_t::in_place_invert()
throw_(amount_error, _("Cannot invert an uninitialized amount"));

_dup();
mpq_inv(MP(quantity), MP(quantity));

if (sign() != 0)
mpq_inv(MP(quantity), MP(quantity));
}

void amount_t::in_place_round()

0 comments on commit 56025cd

Please sign in to comment.