summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-09-06 22:01:24 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-09-06 22:01:24 -0700
commited68b9870b11007c9d1facb2a95caa801eb34f27 (patch)
tree23fe25fcdeb6706c91a84e32648da5b39d3894a3
parent6bb6981952995b511cc6f2aba2f73daf6e794636 (diff)
downloadtxr-ed68b9870b11007c9d1facb2a95caa801eb34f27.tar.gz
txr-ed68b9870b11007c9d1facb2a95caa801eb34f27.tar.bz2
txr-ed68b9870b11007c9d1facb2a95caa801eb34f27.zip
digits/digpow: disallow base 1.
* arith.c (digcommon): Fix wrong test that allows base 1 to be admitted, resulting in infinitely looping behavior.
-rw-r--r--arith.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arith.c b/arith.c
index db9b2deb..e9fd0185 100644
--- a/arith.c
+++ b/arith.c
@@ -3723,7 +3723,7 @@ static val digcommon(int pow, val self, val n, val base_in)
if (!integerp(n) || minusp(n))
uw_throwf(error_s, lit("~a: value ~s must be positive integer"),
self, n, nao);
- if (!integerp(r) || lt(r, one))
+ if (!integerp(r) || le(r, one))
uw_throwf(error_s, lit("~a: base ~s must be positive integer"),
self, r, nao);