mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
preserve -0.0 when added to exact 0
This commit is contained in:
parent
ab3f3ad3a0
commit
f5c47c467d
1 changed files with 1 additions and 1 deletions
2
bignum.c
2
bignum.c
|
@ -1202,7 +1202,7 @@ sexp sexp_add (sexp ctx, sexp a, sexp b) {
|
|||
r = sexp_make_fixnum(sum);
|
||||
break;
|
||||
case SEXP_NUM_FIX_FLO:
|
||||
r = sexp_make_flonum(ctx, sexp_fixnum_to_double(a)+sexp_flonum_value(b));
|
||||
r = a == SEXP_ZERO ? b : sexp_make_flonum(ctx, sexp_fixnum_to_double(a)+sexp_flonum_value(b));
|
||||
break;
|
||||
case SEXP_NUM_FIX_BIG:
|
||||
r = sexp_bignum_normalize(sexp_bignum_add_fixnum(ctx, b, a));
|
||||
|
|
Loading…
Add table
Reference in a new issue