7.4 Floating-point numbers

7.4.3 Floating-point component extraction

integer-decode-float
In Liquid Common Lisp, the output of the functioninteger-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
1

> (integer-decode-float 3.50000000001) 7881299347920886 ;= #x1C0000000057F6 -51 1 >

A true CLtL2-compliant implementation would behave as follows:

> (integer-decode-float 3.5)
7881299347898368                        ;= #x1C000000000000
-51
1

> (integer-decode-float 3.50000000001) 7881299347920886 ;= #x1C0000000057F6 -51 1 >

The very important advantage of the Liquid implementation is that common "small" floating point numbers do not provoke expensive bignums when they are decoded.


The Advanced User's Guide - 9 SEP 1996

Generated with Harlequin WebMaker