From 24511502828ede8f8b6acd27e23ff33c9186c418 Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Wed, 12 Jul 2000 07:38:06 +0000 Subject: [PATCH] * Fixed expt for the case of negative integer exponents. --- ice-9/ChangeLog | 5 +++++ ice-9/boot-9.scm | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index 02f1a1024..6160c876e 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,8 @@ +2000-07-12 Dirk Herrmann + + * boot-9.scm (expt): Make sure that integer-expt is only called + if the exponent is a non-negative integer. + 2000-07-01 Mikael Djurfeldt * boot-9.scm (process-define-module): Bugfix: Only check the CDR diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm index d190a771c..c1e578494 100644 --- a/ice-9/boot-9.scm +++ b/ice-9/boot-9.scm @@ -793,7 +793,7 @@ (define expt (let ((integer-expt integer-expt)) (lambda (z1 z2) - (cond ((exact? z2) + (cond ((and (integer? z2) (>= z2 0)) (integer-expt z1 z2)) ((and (real? z2) (real? z1) (>= z1 0)) ($expt z1 z2)) -- 2.20.1