summaryrefslogtreecommitdiffstats
path: root/arith.c
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
commit75350e11c3a5768df7dd5d88b7147c92b3f99380 (patch)
tree23fe25fcdeb6706c91a84e32648da5b39d3894a3 /arith.c
parent78d6a6ed5cd8a141fdae8e7f85faeadbd5b177b2 (diff)
downloadtxr-75350e11c3a5768df7dd5d88b7147c92b3f99380.tar.gz
txr-75350e11c3a5768df7dd5d88b7147c92b3f99380.tar.bz2
txr-75350e11c3a5768df7dd5d88b7147c92b3f99380.zip
digits/digpow: disallow base 1.
* arith.c (digcommon): Fix wrong test that allows base 1 to be admitted, resulting in infinitely looping behavior.
Diffstat (limited to 'arith.c')
-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);