summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--big.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/big.c b/big.c
index 022b49d..d1cff5f 100644
--- a/big.c
+++ b/big.c
@@ -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)