// 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