]> www.ginac.de Git - cln.git/blobdiff - src/integer/bitwise/cl_I_logcount.cc
Finalize CLN 1.3.7 release.
[cln.git] / src / integer / bitwise / cl_I_logcount.cc
index dd293bf45cddd48e72c62951438f4e4f57986bec..e2674da5d58af12fddc0fe284a5a1c369f16ea09 100644 (file)
@@ -1,7 +1,7 @@
 // logcount().
 
 // General includes.
-#include "cl_sysdep.h"
+#include "base/cl_sysdep.h"
 
 // Specification.
 #include "cln/integer.h"
@@ -9,24 +9,24 @@
 
 // Implementation.
 
-#include "cl_I.h"
-#include "cl_DS.h"
-#include "cl_D.h"
-#include "cl_low.h"
+#include "integer/cl_I.h"
+#include "base/digitseq/cl_DS.h"
+#include "base/digit/cl_D.h"
+#include "base/cl_low.h"
 
 namespace cln {
 
-uintL logcount (const cl_I& x)
+uintC logcount (const cl_I& x)
 {
        if (fixnump(x))
          { var uintV x32 = FN_to_V(x); // x als intDsize-Bit-Zahl
            if (FN_V_minusp(x,(sintV)x32)) { x32 = ~ x32; } // falls <0, komplementieren
             #if (intVsize>32)
             #define x64 x32
-            logcount_64(); // Bits von x32 zählen
+            logcount_64(); // Bits von x32 zählen
             #undef x64
             #else
-           logcount_32(); // Bits von x32 zählen
+           logcount_32(); // Bits von x32 zählen
             #endif
            return x32;
          }
@@ -34,11 +34,11 @@ uintL logcount (const cl_I& x)
           { var const uintD* MSDptr;
             var uintC len;
             BN_to_NDS_nocopy(x, MSDptr=,len=,); // DS zu x bilden, len>0.
-            var uintL bitcount = 0; // Bitzähler
-            var const uintD* ptr = MSDptr; // läuft durch die Digits durch
+            var uintC bitcount = 0; // Bitzähler
+            var const uintD* ptr = MSDptr; // läuft durch die Digits durch
             var uintD sign = sign_of_sintD(mspref(ptr,0)); // Vorzeichen
             dotimespC(len,len,
-              { bitcount += (uintL)logcountD(msprefnext(ptr) ^ sign); });
+              { bitcount += (uintC)logcountD(msprefnext(ptr) ^ sign); });
             // 0 <= bitcount < intDsize*2^intCsize.
             return bitcount;
           }