mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-14 00:17:33 +02:00
fixing bug in mixed fixnum/flonum subtraction
This commit is contained in:
parent
9c9271e625
commit
4c7ca3edb2
2 changed files with 3 additions and 1 deletions
|
@ -554,7 +554,7 @@ sexp sexp_sub (sexp ctx, sexp a, sexp b) {
|
|||
r = sexp_bignum_normalize(r);
|
||||
break;
|
||||
case SEXP_NUM_FLO_FIX:
|
||||
r = sexp_make_flonum(ctx, sexp_fixnum_to_double(b)+sexp_flonum_value(a));
|
||||
r = sexp_make_flonum(ctx, sexp_flonum_value(a) - sexp_fixnum_to_double(b));
|
||||
break;
|
||||
case SEXP_NUM_FLO_FLO:
|
||||
r = sexp_fp_sub(ctx, a, b);
|
||||
|
|
|
@ -205,6 +205,8 @@
|
|||
|
||||
(test -3 (- 3))
|
||||
|
||||
(test -1.0 (- 3.0 4))
|
||||
|
||||
(test 7 (abs -7))
|
||||
|
||||
(test 1 (modulo 13 4))
|
||||
|
|
Loading…
Add table
Reference in a new issue