7 #include "cln/integer.h"
15 #include "cln/integer_io.h"
16 #include "cln/abort.h"
20 cl_boolean logbitp (const cl_I& x, const cl_I& y)
24 // Falls x>=0: Falls x>=intDsize*Länge(y), teste Vorzeichen von y.
25 // Sonst x=intDsize*k+i, Teste Bit i vom Worte Nr. k+1 (von oben herab).
26 if (!minusp(x)) // x>=0 ?
28 { var uintV x_ = FN_to_V(x);
30 var const uintD* yLSDptr;
31 I_to_NDS_nocopy(y, ,ylen=,yLSDptr=,cl_true, { return cl_false; } ); // DS zu y
32 if (x_ < intDsize*ylen)
33 // x ist ein Fixnum >=0, < intDsize*ylen
34 { if (lspref(yLSDptr,floor(x_,intDsize)) & bit(x_%intDsize))
39 // Vorzeichen von y testen
47 { fprint(std::cerr, "logbitp: Index is negative: ");
49 fprint(std::cerr, "\n");