1 // integer_decode_float().
7 #include "cln/ffloat.h"
15 #if defined(__mips__) && !defined(__GNUC__)
17 // Workaround SGI Irix 6.2 C++ 7.0 bug.
20 #include "dfloat/cl_DF.h"
25 const cl_idecoded_float integer_decode_float (const cl_FF& x)
27 var cl_idecoded_float sem = integer_decode_float(cl_FF_to_DF(x));
28 return cl_idecoded_float(sem.mantissa >> (DF_mant_len-FF_mant_len),
29 sem.exponent + (DF_mant_len-FF_mant_len),
41 const cl_idecoded_float integer_decode_float (const cl_FF& x)
47 FF_decode(x, { return cl_idecoded_float(0, 0, 1); },
50 return cl_idecoded_float(
51 (FF_mant_len+1 < cl_value_len
52 ? L_to_FN(mant) // Mantisse als Fixnum
53 : UL_to_I(mant) // oder evtl. als Bignum
55 L_to_FN(exp-(FF_mant_len+1)), // e-24 als Fixnum
56 (sign>=0 ? cl_I(1) : cl_I(-1)) // (-1)^s erzeugen