mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-11 11:42:51 -08:00
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.
This commit is contained in:
parent
f133f72886
commit
e9d7cef106
1 changed files with 3 additions and 2 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue