diff --git a/opt/bignum.c b/opt/bignum.c index 77619d2e..f68f4821 100644 --- a/opt/bignum.c +++ b/opt/bignum.c @@ -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); diff --git a/tests/r5rs-tests.scm b/tests/r5rs-tests.scm index 41919386..048c36d7 100644 --- a/tests/r5rs-tests.scm +++ b/tests/r5rs-tests.scm @@ -205,6 +205,8 @@ (test -3 (- 3)) +(test -1.0 (- 3.0 4)) + (test 7 (abs -7)) (test 1 (modulo 13 4))