From eeda1a1396eb2732e8fe9234bd13d21ac334cfac Mon Sep 17 00:00:00 2001 From: Isaac Hier Date: Thu, 21 Jun 2018 08:17:08 -0400 Subject: [PATCH] Fix logic --- src/bigint.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/bigint.cpp b/src/bigint.cpp index 088703402d..bb227a7c3d 100644 --- a/src/bigint.cpp +++ b/src/bigint.cpp @@ -1685,16 +1685,11 @@ void bigint_incr(BigInt *x) { } if (x->digit_count == 1) { - if (x->is_negative) { - if (x->data.digit != 0) { - x->data.digit -= 1; - } + if (x->is_negative && x->data.digit != 0) { + x->data.digit -= 1; return; - } - else { - if (x->data.digit != UINT64_MAX) { - x->data.digit += 1; - } + } else if (!x->is_negative && x->data.digit != UINT64_MAX) { + x->data.digit += 1; return; } }