X-Git-Url: https://ginac.de/CLN/cln.git//cln.git?a=blobdiff_plain;f=src%2Finteger%2Fbitwise%2Fcl_I_ldb.cc;h=41a699a2db20c9dbd404c6bef8a8510a1de5b70b;hb=8169a19b38c42588b39b21dae5bdb964e2f6b8c6;hp=dd94d5c2c77d5d98e81343d707eede5419ccb6c0;hpb=dd9e0f894eec7e2a8cf85078330ddc0a6639090b;p=cln.git diff --git a/src/integer/bitwise/cl_I_ldb.cc b/src/integer/bitwise/cl_I_ldb.cc index dd94d5c..41a699a 100644 --- a/src/integer/bitwise/cl_I_ldb.cc +++ b/src/integer/bitwise/cl_I_ldb.cc @@ -1,17 +1,19 @@ // ldb(). // General includes. -#include "cl_sysdep.h" +#include "base/cl_sysdep.h" // Specification. -#include "cl_integer.h" +#include "cln/integer.h" // Implementation. -#include "cl_integer.h" -#include "cl_I.h" -#include "cl_I_byte.h" +#include "cln/integer.h" +#include "integer/cl_I.h" +#include "integer/bitwise/cl_I_byte.h" + +namespace cln { const cl_I ldb (const cl_I& n, const cl_byte& b) { @@ -23,10 +25,10 @@ const cl_I ldb (const cl_I& n, const cl_byte& b) // Falls p <= l : // q:=min(p+s,l). // Extrahiere die Bits p,...,q-1 von n. - // Falls p+s>l und n<0, füge p+s-l Einsenbits an (addiere 2^s-2^(l-p)). - var uintL s = b.size; - var uintL p = b.position; - var uintL l = integer_length(n); // l = (integer-length n) + // Falls p+s>l und n<0, füge p+s-l Einsenbits an (addiere 2^s-2^(l-p)). + var uintC s = b.size; + var uintC p = b.position; + var uintC l = integer_length(n); // l = (integer-length n) if (l<=p) // l<=p if (!minusp(n)) @@ -38,7 +40,7 @@ const cl_I ldb (const cl_I& n, const cl_byte& b) else // l>p { var cl_I erg = ldb_extract(n,p,(p+slp) && minusp(n)) // s>l-p und n<0 ? { return logior(erg,cl_fullbyte(lp,s)); } // setze Bits l-p,...,s-1 // (logisches Exklusiv-Oder oder Addition ginge auch) @@ -46,3 +48,5 @@ const cl_I ldb (const cl_I& n, const cl_byte& b) return erg; } } + +} // namespace cln