From 00fa74c7c906a1a21b703834c4c73b28777fe2e3 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Mon, 28 Mar 2022 14:34:30 -0400 Subject: modernize shift() --- big.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/big.c b/big.c index 78049eb..2a640e5 100644 --- a/big.c +++ b/big.c @@ -313,7 +313,6 @@ word bigtimes(word x, word y) return (r); } - //word d = digit0(y); word s = big_is_negative(y); for (word n = 0, d = digit0(y); y; n++, d = digit(y)) { if (d) { @@ -321,18 +320,19 @@ word bigtimes(word x, word y) } y = rest(y); - //d = digit(y); } return (s != big_is_negative(x) ? bignegate(r) : r); } -word shift(n, x) /* multiply big x by n'th power of IBASE */ -word n, x; +/* multiply big x by n'th power of IBASE */ +word shift(word n, word x) { - while (n--) + while (n--) { x = make(INT, 0, x); - return (x); -} /* NB - we assume x non-zero, else unnormalised result */ + } + + return x; +} word stimes(x, n) /* multiply big x (>=0) by digit n (>0) */ word x, n; -- cgit v1.2.1