From: Chris Hanson Date: Wed, 13 Oct 2004 02:02:23 +0000 (+0000) Subject: Fix minor bug in EXPT: wrong error was being signalled for (EXPT 0 +I). X-Git-Tag: 20090517-FFI~1563 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=cfbeb0ec30d2266a0d9339092e3c798dcd91e778;p=mit-scheme.git Fix minor bug in EXPT: wrong error was being signalled for (EXPT 0 +I). --- diff --git a/v7/src/runtime/arith.scm b/v7/src/runtime/arith.scm index fdb0aad09..32667c640 100644 --- a/v7/src/runtime/arith.scm +++ b/v7/src/runtime/arith.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: arith.scm,v 1.59 2004/06/12 02:14:41 cph Exp $ +$Id: arith.scm,v 1.60 2004/10/13 02:02:23 cph Exp $ Copyright 1989,1990,1991,1992,1993,1994 Massachusetts Institute of Technology Copyright 1995,1996,1997,1999,2001,2002 Massachusetts Institute of Technology @@ -1697,12 +1697,14 @@ USA. (define (complex:expt z1 z2) (cond ((complex:zero? z1) - (cond ((complex:zero? z2) - (if (complex:exact? z2) - 1 - (error:bad-range-argument z2 'EXPT))) - ((complex:positive? z2) (real:0 (complex:exact? z1))) - (else (error:divide-by-zero 'EXPT (list z1 z2))))) + (cond ((eqv? z2 0) + 1) + ((real:positive? (complex:real-part z2)) + (real:0 (complex:exact? z1))) + ((real:zero? (complex:real-part z2)) + (error:bad-range-argument z2 'EXPT)) + (else + (error:divide-by-zero 'EXPT (list z1 z2))))) ((and (recnum? z1) (int:integer? z2)) (let ((exact-method