diff options
author | Jakob Kaivo <jkk@ung.org> | 2022-03-28 14:34:30 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2022-03-28 14:34:30 -0400 |
commit | 00fa74c7c906a1a21b703834c4c73b28777fe2e3 (patch) | |
tree | 729c353a9b13c1e7789efdf03d15b5514ca9ca91 | |
parent | a624e05d31c367d90c3fa8015bb1e12d3d1c2e45 (diff) |
modernize shift()
-rw-r--r-- | big.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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; |