]> www.ginac.de Git - cln.git/blob - src/float/lfloat/misc/cl_LF_decode.cc
* All Files have been modified for inclusion of namespace cln;
[cln.git] / src / float / lfloat / misc / cl_LF_decode.cc
1 // decode_float().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cln/lfloat.h"
8
9
10 // Implementation.
11
12 #include "cl_LF.h"
13 #include "cl_LF_impl.h"
14 #include "cl_I.h"
15
16 namespace cln {
17
18 const decoded_lfloat decode_float (const cl_LF& x)
19 {
20         // x entpacken:
21         var cl_signean sign;
22         var sintL exp;
23         var uintC mantlen;
24         var const uintD* mantMSDptr;
25         LF_decode(x, { return decoded_lfloat(x, 0, encode_LF1(mantlen)); },
26                      sign=,exp=,mantMSDptr=,mantlen=,);
27         return decoded_lfloat(
28                 encode_LFu(0,0+LF_exp_mid,mantMSDptr,mantlen), // (-1)^0 * 2^0 * m erzeugen
29                 L_to_I(exp), // e als Fixnum
30                 encode_LF1s(sign,mantlen) // (-1)^s erzeugen
31                );
32 }
33
34 }  // namespace cln