diff options
-rw-r--r-- | big.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -88,13 +88,16 @@ long long get_int(word x) return (sign ? -n : n); } -word bignegate(x) -word x; +word bignegate(word x) { - if (bigzero(x)) - return (x); - return (make - (INT, hd[x] & SIGNBIT ? hd[x] & MAXDIGIT : SIGNBIT | hd[x], tl[x])); + if (bigzero(x)) { + return x; + } + + if (hd[x] & SIGNBIT) { + return make(INT, hd[x] & MAXDIGIT, tl[x]); + } + return make(INT, SIGNBIT | hd[x], tl[x]); } word bigplus(x, y) |