mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 13:49:17 +02:00
parent
345da04e72
commit
64b8e5f8a3
1 changed files with 2 additions and 2 deletions
4
eval.c
4
eval.c
|
@ -1675,9 +1675,9 @@ sexp sexp_expt_op (sexp ctx, sexp self, sexp_sint_t n, sexp x, sexp e) {
|
||||||
return sexp_type_exception(ctx, self, SEXP_FIXNUM, e);
|
return sexp_type_exception(ctx, self, SEXP_FIXNUM, e);
|
||||||
f = pow(x1, e1);
|
f = pow(x1, e1);
|
||||||
if ((f*1000.0 > SEXP_MAX_FIXNUM) || (f*1000.0 < SEXP_MIN_FIXNUM)
|
if ((f*1000.0 > SEXP_MAX_FIXNUM) || (f*1000.0 < SEXP_MIN_FIXNUM)
|
||||||
|| (! sexp_fixnump(x)) || (! sexp_fixnump(e))) {
|
|| (! sexp_fixnump(x)) || (! sexp_fixnump(e)) || (e1 < 0.0)) {
|
||||||
#if SEXP_USE_BIGNUMS
|
#if SEXP_USE_BIGNUMS
|
||||||
if (sexp_fixnump(x) && sexp_fixnump(e)) {
|
if (sexp_fixnump(x) && sexp_fixnump(e) && (e1 >= 0.0)) {
|
||||||
sexp_gc_preserve1(ctx, tmp);
|
sexp_gc_preserve1(ctx, tmp);
|
||||||
tmp = sexp_fixnum_to_bignum(ctx, x);
|
tmp = sexp_fixnum_to_bignum(ctx, x);
|
||||||
res = sexp_bignum_expt(ctx, tmp, e);
|
res = sexp_bignum_expt(ctx, tmp, e);
|
||||||
|
|
Loading…
Add table
Reference in a new issue