mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-21 06:39:17 +02:00
(/ big big) and (- big flo) patches from lorenzo campedelli (issue 31)
This commit is contained in:
parent
59e88c7ded
commit
d4eaecd658
1 changed files with 2 additions and 1 deletions
|
@ -565,6 +565,7 @@ sexp sexp_sub (sexp ctx, sexp a, sexp b) {
|
||||||
break;
|
break;
|
||||||
case SEXP_NUM_BIG_FLO:
|
case SEXP_NUM_BIG_FLO:
|
||||||
r = sexp_make_flonum(ctx, sexp_flonum_value(b) - sexp_bignum_to_double(a));
|
r = sexp_make_flonum(ctx, sexp_flonum_value(b) - sexp_bignum_to_double(a));
|
||||||
|
break;
|
||||||
case SEXP_NUM_BIG_BIG:
|
case SEXP_NUM_BIG_BIG:
|
||||||
r = sexp_bignum_normalize(sexp_bignum_sub(ctx, NULL, a, b));
|
r = sexp_bignum_normalize(sexp_bignum_sub(ctx, NULL, a, b));
|
||||||
break;
|
break;
|
||||||
|
@ -646,7 +647,7 @@ sexp sexp_div (sexp ctx, sexp a, sexp b) {
|
||||||
r = sexp_bignum_quot_rem(ctx, &rem, a, b);
|
r = sexp_bignum_quot_rem(ctx, &rem, a, b);
|
||||||
if (sexp_bignum_normalize(rem) != SEXP_ZERO)
|
if (sexp_bignum_normalize(rem) != SEXP_ZERO)
|
||||||
r = sexp_make_flonum(ctx, sexp_bignum_to_double(a)
|
r = sexp_make_flonum(ctx, sexp_bignum_to_double(a)
|
||||||
/ sexp_fixnum_to_double(b));
|
/ sexp_bignum_to_double(b));
|
||||||
else
|
else
|
||||||
r = sexp_bignum_normalize(r);
|
r = sexp_bignum_normalize(r);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue