diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-09-06 22:02:04 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-09-06 22:02:04 -0700 |
commit | eb8344963b2606cff7ba2ebaa1eafd6ec0b6766e (patch) | |
tree | c8320cf8ac87156f65defe6ade1e67a08db8c16d | |
parent | ed68b9870b11007c9d1facb2a95caa801eb34f27 (diff) | |
download | txr-eb8344963b2606cff7ba2ebaa1eafd6ec0b6766e.tar.gz txr-eb8344963b2606cff7ba2ebaa1eafd6ec0b6766e.tar.bz2 txr-eb8344963b2606cff7ba2ebaa1eafd6ec0b6766e.zip |
digits/digpow: wrong results for radix powers.
* arith.c (digcommon): Fix off-by-one test causing incorrect
results for radix powers like (digits 10) (digits 100) ...
and analogously in other radices. Reported by vapnik spaknik.
-rw-r--r-- | arith.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -3732,7 +3732,7 @@ static val digcommon(int pow, val self, val n, val base_in) val p = nil, p0; list_collect_decl (out, ptail); - while (lt(k, n)) { + while (le(k, n)) { push(k, &p); k = mul(k, r); } |