]> www.ginac.de Git - cln.git/blob - src/float/ffloat/misc/cl_FF_decode.cc
31c1ccf79d8b374d523a0e4be81cc03631c5be4c
[cln.git] / src / float / ffloat / misc / cl_FF_decode.cc
1 // decode_float().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cl_ffloat.h"
8
9
10 // Implementation.
11
12 #include "cl_FF.h"
13 #include "cl_I.h"
14
15 const cl_decoded_ffloat decode_float (const cl_FF& x)
16 {
17         // x entpacken:
18         var cl_signean sign;
19         var sintL exp;
20         var uint32 mant;
21         FF_decode(x, { return cl_decoded_ffloat(cl_FF_0, 0, cl_FF_1); },
22                      sign=,exp=,mant=
23                  );
24         return cl_decoded_ffloat(
25                 encode_FF(0,0,mant), // (-1)^0 * 2^0 * m erzeugen
26                 L_to_FN(exp), // e als Fixnum
27                 encode_FF(sign,1,bit(FF_mant_len)) // (-1)^s erzeugen
28                );
29 }