3 Apr
2017
3 Apr
'17
5:45 p.m.
Hmmm... In Lisp this can be (expensively) computed by (/ x (decode-float x)) i.e., (/ pi (decode-float pi)) == 4.0 decode-float returns as its first value a float whose exponent is set to zero, so we can divide by this number to wipe out the mantissa. At 01:52 PM 4/3/2017, Henry Baker wrote:
Is there a name for the function that simply kills all of the bits of precision from an IEEE floating point number, leaving it as a simple power of 2 ?
For a big-endian machine, pick up the 32 bits of the IEEE32 float and AND it with -2^23.
Or pick up 64 bits of IEEE64 float and AND it with -2^52.