1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 22:10:21 +02:00

(scm_gcd): In bignum/inum, don't pass yy==0 to mpz_gcd_ui

since we're only using the ulong return value, and x might not fit.
This commit is contained in:
Kevin Ryde 2003-05-10 00:20:05 +00:00
parent a04a3604c2
commit 8c5b0afcbf

View file

@ -708,6 +708,8 @@ scm_gcd (SCM x, SCM y)
{
unsigned long result;
long yy = SCM_INUM (y);
if (yy == 0)
return scm_abs (x);
if (yy < 0) yy = -yy;
result = mpz_gcd_ui (NULL, SCM_I_BIG_MPZ (x), yy);
scm_remember_upto_here_1 (x);