[math-fun] Name for function IEEE32(x) LOGAND -2^23 ??
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.
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.
Is that what you really want for denormalized floats? On 03-Apr-17 16:52, 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.
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
participants (2)
-
Henry Baker -
Mike Speciner