]> www.ginac.de Git - cln.git/blobdiff - src/integer/gcd/cl_I_gcd_aux2.cc
Avoid shifting a 32-bit zero value by more than 31 bits.
[cln.git] / src / integer / gcd / cl_I_gcd_aux2.cc
index adb6f6123eab4115d27e8269ee8f92c9244808e4..507220d9836993d8fc4c5640dfa4b579ceca713f 100644 (file)
@@ -9,9 +9,11 @@
 
 // Implementation.
 
-#include "cl_integer.h"
+#include "cln/integer.h"
 #include "cl_D.h"
 
+namespace cln {
+
 // Dasselbe wie partial_gcd(z1,z2,erg), nur daß z1 und z2 Doppelworte sind.
 // Bevor im Ergebnis erg ein Überlauf eintritt, wird abgebrochen.
 
@@ -45,7 +47,7 @@ static uintD floorDD (uintDD x, uintDD y)
                if (y_shifted == 0)
                        q = highD(x) >> shift;
                else
-                       divuD(x,y_shifted, q =, );
+                       divuD(highD(x) >> shift, y_shifted, q =, );
        }
        // May need to increment q at most twice.
        {
@@ -451,3 +453,5 @@ void partial_gcd (uintD z1hi, uintD z1lo, uintD z2hi, uintD z2lo, partial_gcd_re
 }
 
 #endif
+
+}  // namespace cln