#include "cl_LF_impl.h"
#include "cl_DS.h"
+namespace cln {
+
const cl_LF futruncate (const cl_LF& x)
{
// Methode:
// e>=16n -> Ergebnis x.
#if 0
var cl_signean sign;
- var sintL exp;
+ var sintE exp;
var const uintD* mantMSDptr;
var uintC mantlen;
LF_decode(x, { return x; }, sign=,exp=,mantMSDptr=,mantlen=,);
if (exp<=0) { return encode_LF1s(sign,mantlen); } // e<=0 -> Ergebnis +-1.0
- if ((uintL)exp >= intDsize*(uintL)mantlen) // e>=16n -> x als Ergebnis
+ if ((uintE)exp >= intDsize*mantlen) // e>=16n -> x als Ergebnis
{ return x; }
else
// 0 < e < 16n
{ // Testen, ob alle hinteren 16n-e Bits =0 sind:
- var uintC count = floor((uintL)exp,intDsize); // zu kopierende Digits, < mantlen
- var uintC bitcount = ((uintL)exp) % intDsize; // zu kopierende Bits danach, >=0, <intDsize
+ var uintC count = floor((uintE)exp,intDsize); // zu kopierende Digits, < mantlen
+ var uintC bitcount = ((uintE)exp) % intDsize; // zu kopierende Bits danach, >=0, <intDsize
var uintD mask = minus_bitm(intDsize-bitcount); // Maske mit bitcount Bits
var uintD* mantptr = mantMSDptr mspop count;
if ( ((mspref(mantptr,0) & ~mask) ==0)
}
#else
var uintC len = TheLfloat(x)->len;
- var uintL uexp = TheLfloat(x)->expo;
+ var uintE uexp = TheLfloat(x)->expo;
if (uexp <= LF_exp_mid)
{ if (uexp == 0) { return x; } // x=0.0 -> Ergebnis 0.0
return encode_LF1s(TheLfloat(x)->sign,len); // e<=0 -> Ergebnis +-1.0
}
- var uintL exp = uexp - LF_exp_mid;
- if (exp >= intDsize*(uintL)len) // e>=16n -> x als Ergebnis
+ var uintE exp = uexp - LF_exp_mid;
+ if (exp >= intDsize*len) // e>=16n -> x als Ergebnis
{ return x; }
// 0 < e < 16n
// Testen, ob alle hinteren 16n-e Bits =0 sind:
return y;
#endif
}
+
+} // namespace cln