1 // integer_decode_float().
7 #include "cln/lfloat.h"
19 const cl_idecoded_float integer_decode_float (const cl_LF& x)
22 var uintL uexp = TheLfloat(x)->expo;
24 { return cl_idecoded_float(0, 0, 1); }
25 var cl_signean sign = TheLfloat(x)->sign;
26 var uintC len = TheLfloat(x)->len;
27 // intDsize*len >= 53 >= 33 >= cl_value_len, also len >= bn_minlength.
28 // Baue Integer für die Mantisse.
29 // Vorne 1 Nulldigit, damit es eine NDS wird.
30 var Bignum mant = allocate_bignum(1+len);
31 mspref(arrayMSDptr(TheBignum(mant)->data,1+len),0) = 0;
32 copy_loop_msp(arrayMSDptr(TheLfloat(x)->data,len),arrayMSDptr(TheBignum(mant)->data,1+len) mspop 1,len); // NUDS kopieren
33 return cl_idecoded_float(
36 // e-intDsize*n = uexp-LF_exp_mid-intDsize*n als Integer
37 minus(uexp, LF_exp_mid + intDsize*len),
38 (sign>=0 ? cl_I(1) : cl_I(-1)) // (-1)^s erzeugen