1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-22 12:30:32 +02:00

(scm_difference): Correction to bignum - negative inum.

This commit is contained in:
Kevin Ryde 2003-08-22 01:17:48 +00:00
parent fde791b502
commit 708f22c6af

View file

@ -3370,7 +3370,10 @@ scm_difference (SCM x, SCM y)
{ {
SCM result = scm_i_mkbig (); SCM result = scm_i_mkbig ();
if (yy >= 0)
mpz_sub_ui (SCM_I_BIG_MPZ (result), SCM_I_BIG_MPZ (x), yy); mpz_sub_ui (SCM_I_BIG_MPZ (result), SCM_I_BIG_MPZ (x), yy);
else
mpz_add_ui (SCM_I_BIG_MPZ (result), SCM_I_BIG_MPZ (x), -yy);
scm_remember_upto_here_1 (x); scm_remember_upto_here_1 (x);
if ((sgn_x < 0 && (yy > 0)) || ((sgn_x > 0) && yy < 0)) if ((sgn_x < 0 && (yy > 0)) || ((sgn_x > 0) && yy < 0))