Title: Floats are read with single precision by default
|Description: Floating point numbers are read by default as single-float values. This is the default Common Lisp behavior (see|
The single-float type has only 23 bits in the mantissa, resulting in apparent loss of precision for some numbers such as
(- 605113171.148 605113170.148) => 0.0
However, if you force these numbers to be read as double-float, then the form returns the expected result, for example:
(- 605113171.148d0 605113170.148d0) => 1.0D0
Note: LispWorks 4 on Windows and Linux has a different default behavior. See other article for details.
|See Also: (link)|