HCoop
/
bpt
/
guile.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0e12d40
)
(expt): Only call integer-expt for an exact integer exponent, not for
author
Marius Vollmer
<mvo@zagadka.de>
Wed, 8 Sep 2004 14:34:51 +0000
(14:34 +0000)
committer
Marius Vollmer
<mvo@zagadka.de>
Wed, 8 Sep 2004 14:34:51 +0000
(14:34 +0000)
an inexact integer one. Also, let integer-expt handle negative
exponents instead of doing it here.
ice-9/boot-9.scm
patch
|
blob
|
blame
|
history
diff --git
a/ice-9/boot-9.scm
b/ice-9/boot-9.scm
index
e854f6d
..
95c6fa6
100644
(file)
--- a/
ice-9/boot-9.scm
+++ b/
ice-9/boot-9.scm
@@
-780,10
+780,8
@@
(define expt
(let ((integer-expt integer-expt))
(lambda (z1 z2)
- (cond ((integer? z2)
- (if (negative? z2)
- (/ 1 (integer-expt z1 (- z2)))
- (integer-expt z1 z2)))
+ (cond ((and (exact? z2) (integer? z2))
+ (integer-expt z1 z2))
((and (real? z2) (real? z1) (>= z1 0))
($expt z1 z2))
(else