HCoop
/
bpt
/
guile.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a04a360
)
(scm_gcd): In bignum/inum, don't pass yy==0 to mpz_gcd_ui
author
Kevin Ryde
<user42@zip.com.au>
Sat, 10 May 2003 00:20:05 +0000
(
00:20
+0000)
committer
Kevin Ryde
<user42@zip.com.au>
Sat, 10 May 2003 00:20:05 +0000
(
00:20
+0000)
since we're only using the ulong return value, and x might not fit.
libguile/numbers.c
patch
|
blob
|
blame
|
history
diff --git
a/libguile/numbers.c
b/libguile/numbers.c
index
4a82873
..
c690763
100644
(file)
--- a/
libguile/numbers.c
+++ b/
libguile/numbers.c
@@
-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);