diff --git a/eval.c b/eval.c index bd676fa3..9948b8b4 100644 --- a/eval.c +++ b/eval.c @@ -1718,11 +1718,6 @@ sexp sexp_expt_op (sexp ctx, sexp self, sexp_sint_t n, sexp x, sexp e) { res = sexp_make_flonum(ctx, pow(10.0, 1e100)); /* +inf.0 */ } else if (sexp_bignump(x)) { res = sexp_bignum_expt(ctx, x, e); - } else if (sexp_fixnump(x)) { - sexp_gc_preserve1(ctx, tmp); - tmp = sexp_fixnum_to_bignum(ctx, x); - res = sexp_bignum_expt(ctx, tmp, e); - sexp_gc_release1(ctx); } else { #endif if (sexp_fixnump(x)) @@ -1754,7 +1749,7 @@ sexp sexp_expt_op (sexp ctx, sexp self, sexp_sint_t n, sexp x, sexp e) { if ((f*1000.0 > SEXP_MAX_FIXNUM) || (f*1000.0 < SEXP_MIN_FIXNUM) || (! sexp_fixnump(x)) || (! sexp_fixnump(e)) || (e1 < 0.0)) { #if SEXP_USE_BIGNUMS - if (sexp_fixnump(x) && sexp_fixnump(e) && (e1 >= 0.0)) { + if (sexp_fixnump(x) && sexp_fixnump(e)) { sexp_gc_preserve1(ctx, tmp); tmp = sexp_fixnum_to_bignum(ctx, x); res = sexp_bignum_expt(ctx, tmp, e); diff --git a/lib/chibi/numeric-test.sld b/lib/chibi/numeric-test.sld index c329be29..eba066ec 100644 --- a/lib/chibi/numeric-test.sld +++ b/lib/chibi/numeric-test.sld @@ -21,6 +21,7 @@ (test 3 (expt 3 1)) (test 1/3 (expt 3 -1)) (test 1/300000000000000000000 (expt 300000000000000000000 -1)) + (test 16384.0 (expt 2 14.0)) (test '(536870912 536870913 536870911 -536870912 -536870911 -536870913) (integer-neighborhoods (expt 2 29)))