mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-20 22:29:16 +02:00
Fixing fixnum results with remainders in bignum sqrt.
This commit is contained in:
parent
c5e4384821
commit
c559ae11be
1 changed files with 1 additions and 1 deletions
2
bignum.c
2
bignum.c
|
@ -509,7 +509,7 @@ sexp sexp_bignum_sqrt (sexp ctx, sexp a) { /* Babylonian method */
|
|||
/* convert back to inexact if non-zero remainder */
|
||||
rem = sexp_bignum_normalize(rem);
|
||||
if (rem != SEXP_ZERO)
|
||||
res = sexp_make_flonum(ctx, sexp_bignum_to_double(res));
|
||||
res = sexp_make_flonum(ctx, sexp_fixnump(res) ? sexp_unbox_fixnum(res) : sexp_bignum_to_double(res));
|
||||
}
|
||||
sexp_gc_release4(ctx);
|
||||
return sexp_bignum_normalize(res);
|
||||
|
|
Loading…
Add table
Reference in a new issue