]> www.ginac.de Git - cln.git/blobdiff - src/integer/gcd/cl_I_xgcd.cc
Avoid shifting a 32-bit zero value by more than 31 bits.
[cln.git] / src / integer / gcd / cl_I_xgcd.cc
index 8286ec3146e8c0a444b725b6e0d93b75362dd0f8..d99272ac5cc8eb8037629288e5a2a101052aaf5c 100644 (file)
@@ -4,7 +4,7 @@
 #include "cl_sysdep.h"
 
 // Specification.
-#include "cl_integer.h"
+#include "cln/integer.h"
 
 
 // Implementation.
@@ -14,6 +14,8 @@
 #include "cl_D.h"
 #include "cl_xmacros.h"
 
+namespace cln {
+
 #define GCD_ALGO 3  // 1: binär, 2: Schulmethode, 3: Lehmer
 
 
@@ -58,7 +60,7 @@
         { *u = ua; *v = va; return a; }
       if (eq(a,0)) // a=0 -> g=b, (u,v) = (ub,vb)
         { *u = ub; *v = vb; return b; }
-      { var cl_signean vergleich = cl_compare(a,b);
+      { var cl_signean vergleich = compare(a,b);
         if (vergleich == 0) // a=b -> fertig
           { *u = ua; *v = va; return a; }
         if (vergleich < 0) // a<b -> a,b vertauschen
     }
 
 #endif /* GCD_ALGO == 3 */
+
+}  // namespace cln