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"
24 CL_INLINE const cl_idecoded_float CL_INLINE_DECL(integer_decode_float) (const cl_FF& x)
26 var cl_idecoded_float sem = integer_decode_float(cl_FF_to_DF(x));
27 return cl_idecoded_float(sem.mantissa >> (DF_mant_len-FF_mant_len),
28 sem.exponent + (DF_mant_len-FF_mant_len),
39 CL_INLINE const cl_idecoded_float CL_INLINE_DECL(integer_decode_float) (const cl_FF& x)
45 FF_decode(x, { return cl_idecoded_float(0, 0, 1); },
48 return cl_idecoded_float(
49 (FF_mant_len+1 < cl_value_len
50 ? L_to_FN(mant) // Mantisse als Fixnum
51 : UL_to_I(mant) // oder evtl. als Bignum
53 L_to_FN(exp-(FF_mant_len+1)), // e-24 als Fixnum
54 (sign>=0 ? cl_I(1) : cl_I(-1)) // (-1)^s erzeugen