[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*To*: clisp-list <clisp-list@ma2s2.mathematik.uni-karlsruhe.de>*Subject*: Re: CLTL compatible type contagion?*From*: Marcus Daniels <marcus@sysc.pdx.edu>*Date*: Sun, 6 Aug 1995 20:45:28 GMT*In-reply-to*: <m0sfDsM-00006sC@therat.math.waikato.ac.nz>*References*: <m0sfDsM-00006sC@therat.math.waikato.ac.nz>

I'll spare another the trouble... 12.1.4.2 Rule of Float Approximation Computations with floats are only approximate, although they are described as if the results were mathematically accurate. Two mathematically identical expressions may be computationally different because of erros inherent in the floating-point approximation process. The precision of a float is not necessarily correlated with the accuracy of that number. For instance, 3.142857142857142857 is a more precise approximation to pi than 3.14159, but the latter is more accurate. The precision refers to the number of bits retained in the representation. When a operation combines a short float with a long float, the result will be a long float. Common Lisp functions assume that the accuracy of arguments to them does not exceed their precision. Therefore when two small floats are combined, the result is a small float. Common Lisp functions never convert automatically from a larger size to a smaller size. Yet, CLISP does, and my understanding is that it does this because: "Common Lisp functions assume that the accuracy of arguments to them does not exceed their precision" is such a wildly optimistic assumption. Seems to me it is fairly easy to set things up to avoid the need for contagion, and the same program will work fine on a CL that doesn't mind playing it fast and loose with floating point precision.

**References**:**Re: CLTL compatible type contagion?***From:*rls@therat.math.waikato.ac.nz (Richard Shepherd)

- Prev by Date:
**Re: CLTL compatible type contagion?** - Next by Date:
**Re: CLTL compatible type contagion?** - Previous by thread:
**Re: CLTL compatible type contagion?** - Next by thread:
**Re: CLTL compatible type contagion?** - Index(es):