From e9d7cef10604c8d1bba67aa46ec72c03315344bf Mon Sep 17 00:00:00 2001 From: jjgarcia Date: Mon, 8 Dec 2003 09:36:47 +0000 Subject: [PATCH] EXPT should return 1 whenever the exponent is 0 (Even if it is a float). This 1 is coerced to the type of the exponent, not of the base number. --- src/c/num_sfun.d | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/c/num_sfun.d b/src/c/num_sfun.d index 888dace62..3c5275eab 100644 --- a/src/c/num_sfun.d +++ b/src/c/num_sfun.d @@ -92,8 +92,8 @@ cl_expt(cl_object x, cl_object y) cl_type ty; cl_object z; - if (y == MAKE_FIXNUM(0)) - switch (type_of(x)) { + if (number_zerop(y)) { + switch (type_of(y)) { case t_fixnum: case t_bignum: case t_ratio: return1(MAKE_FIXNUM(1)); @@ -111,6 +111,7 @@ cl_expt(cl_object x, cl_object y) default: FEtype_error_number(x); } + } ty = type_of(y); if (number_zerop(x)) { if (!number_plusp(ty==t_complex?y->complex.real:y))