1 #ifndef MSP_DATAFILE_BINFLOAT_H_
2 #define MSP_DATAFILE_BINFLOAT_H_
10 Facilitates splitting floating-point numbers into parts and putting them back
11 together. Supports arbitary sizes up to 64 bits. The 16, 32 and 64 bit
12 formats exactly match those defined by ISO/IEC 60559:2011.
14 The exponent is stored in an unbiased form. The mantissa is stored with the
15 integer part included, aligned to the high bits of a 64-bit integer.
31 typename MatchingInt<T>::UnsignedType i;
39 static BinFloat explode(UInt64, const Bits &);
42 static BinFloat explode_iec559(T v)
46 return explode(c.i, sizeof(T)*CHAR_BIT);
49 UInt64 compose(const Bits &);
55 c.i = compose(sizeof(T)*CHAR_BIT);
60 } // namespace DataFile