7.4 Floating-point numbers
integer-decode-floatIn Liquid Common Lisp, the output of the function
integer-decode-float
differs from the output documented in CLtL2. Specifically, in some cases we adjust the output of the "exponent" part so that the output of the "mantissa" part can be right-shifted by 32 bits, thus eliding 32 trailing zeros (in binary notation). Consider the following example:> (integer-decode-float 3.5) 14680064 ;= #xE00000 -22 1A true CLtL2-compliant implementation would behave as follows:> (integer-decode-float 3.50000000001) 7881299347920886 ;= #x1C0000000057F6 -51 1 >
> (integer-decode-float 3.5) 7881299347898368 ;= #x1C000000000000 -51 1The very important advantage of the Liquid implementation is that common "small" floating point numbers do not provoke expensive bignums when they are decoded.> (integer-decode-float 3.50000000001) 7881299347920886 ;= #x1C0000000057F6 -51 1 >
Generated with Harlequin WebMaker