]> www.ginac.de Git - cln.git/blobdiff - src/integer/bitwise/cl_I_logbitp.cc
Avoid some "suggest explicit braces to avoid ambiguous ‘else’" warnings.
[cln.git] / src / integer / bitwise / cl_I_logbitp.cc
index 0353ee0ee112cf076ad2274473458d997ceaa51b..2c0884682a449c4886d9b7b1ab559e817082065b 100644 (file)
@@ -1,37 +1,41 @@
 // logbitp().
 
 // General includes.
-#include "cl_sysdep.h"
+#include "base/cl_sysdep.h"
 
 // Specification.
-#include "cl_integer.h"
+#include "cln/integer.h"
 
 
 // Implementation.
 
-#include "cl_I.h"
-#include "cl_DS.h"
+#include "integer/cl_I.h"
+#include "base/digitseq/cl_DS.h"
 
-cl_boolean logbitp (uintL x, const cl_I& y)
+namespace cln {
+
+bool logbitp (uintC x, const cl_I& y)
 {
     // Methode:
-    // Falls x>=intDsize*Länge(y), teste Vorzeichen von y.
+    // Falls x>=intDsize*Länge(y), teste Vorzeichen von y.
     // Sonst x=intDsize*k+i, Teste Bit i vom Worte Nr. k+1 (von oben herab).
 
        var const uintD* yMSDptr;
        var uintC ylen;
        var const uintD* yLSDptr;
-       I_to_NDS_nocopy(y, yMSDptr=,ylen=,yLSDptr=,cl_true, { return cl_false; } ); // DS zu y
-       if (x < intDsize*(uintL)ylen)
+       I_to_NDS_nocopy(y, yMSDptr=,ylen=,yLSDptr=,true, { return false; } ); // DS zu y
+       if (x < intDsize*ylen)
                // x ist >=0, < intDsize*ylen
                { if (lspref(yLSDptr,floor(x,intDsize)) & bit(x%intDsize))
-                   return cl_true;
+                   return true;
                    else
-                   return cl_false;
+                   return false;
                }
        // Vorzeichen von y testen
        if (/* (ylen > 0) && */ ((sintD)mspref(yMSDptr,0) < 0))
-           return cl_true;
+           return true;
            else
-           return cl_false;
+           return false;
 }
+
+}  // namespace cln