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 | 337e47fb140beea69af30d3e8f84307ee244afb4 (patch) | |
tree | c8320cf8ac87156f65defe6ade1e67a08db8c16d | |
parent | 75350e11c3a5768df7dd5d88b7147c92b3f99380 (diff) | |
download | txr-337e47fb140beea69af30d3e8f84307ee244afb4.tar.gz txr-337e47fb140beea69af30d3e8f84307ee244afb4.tar.bz2 txr-337e47fb140beea69af30d3e8f84307ee244afb4.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); } |