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:
parent
a04a3604c2
commit
8c5b0afcbf
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue