Eric Fisher <[EMAIL PROTECTED]> writes: > I guess that the macro NGARDS is relevant to the guard digit. But I > still failed to have a clear conception about what it means. Others > are easy to know by IEEE 754 and "What Every Computer Scientist Should > Know about Floating-Point Arithmetic". Except, > > define NGARDS 8L > define GARDROUND 0x7f > define GARDMASK 0xff > define GARDMSB 0x80 > > what do these mean? :-)
NGARDS is the number of guard bits--as I recall you need at least two guard bits, and beyond that fp-bit just fills out to the next byte boundary. GARDROUND is a mask for the bits - 1, GARDMASK is a mask for the bits, GARDMSB is the most significant guard bit. > Especially when unpack a signal floating point, the fraction takes > such an operation at last, that make me much confused. > dst->fraction.ll = (fraction << NGARDS) | IMPLICIT_1; The left shift makes room for the guard bits. The IMPLICIT_1 is the implicit 1 found in the IEEE-754 floating point mantissa. Ian