1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-09 15:10:29 +02:00

(scm_integer_expt): Make 0^z == 0 for z != 0. Also for reals.

This commit is contained in:
Marius Vollmer 2002-11-03 22:02:10 +00:00
parent 1a9e764e6b
commit 819c7b28df

View file

@ -1122,7 +1122,7 @@ SCM_DEFINE (scm_integer_expt, "integer-expt", 2, 0, 0,
#ifdef SCM_BIGDIG
/* 0^0 == 1 according to R5RS */
if (SCM_EQ_P (n, SCM_INUM0) || SCM_EQ_P (n, acc))
return SCM_EQ_P (k, SCM_INUM0)? acc : n;
return SCM_FALSEP (scm_zero_p(k)) ? n : acc;
else if (SCM_EQ_P (n, SCM_MAKINUM (-1L)))
return SCM_FALSEP (scm_even_p (k)) ? n : acc;
#endif