Re: Floating point issue in sbcl 1.0.10?
- From: Brian Adkins <lojicdotcom@xxxxxxxxx>
- Date: Tue, 30 Oct 2007 19:25:33 -0700
On Oct 30, 8:07 pm, steven.w.lev...@xxxxxxxxx wrote:
As a lisp newbie, I'm sorry if this one is obvious. However, I'm a
bit puzzled by the
following executed from the prompt:
* (- 1234.56 4.57)
1229.9901
I tried this with several installations of this (ubuntu, compiled from
src, and
precompiled binary). Any ideas?
If you're wondering about the lack of perfection, other posts have
addressed that. If you're wondering about the lack of precision, the
following may provide some insight:
CLisp 2.41
[1]> (- 1234.56 4.57)
1229.9901
[2]> (- 1234.56d0 4.57d0)
1229.99d0
[3]> (- 1234.56l0 4.57l0)
1229.9900000000000001L0
[4]> (- 1234.56f0 4.57f0)
1229.9901
I just looked that up on p. 118 of Practical Common Lisp. Are there
other ways to indicate to the compiler which precision one wants?
Brian Adkins
.
- Follow-Ups:
- Re: Floating point issue in sbcl 1.0.10?
- From: Alex Mizrahi
- Re: Floating point issue in sbcl 1.0.10?
- References:
- Floating point issue in sbcl 1.0.10?
- From: steven . w . levine
- Floating point issue in sbcl 1.0.10?
- Prev by Date: Re: Floating point issue in sbcl 1.0.10?
- Next by Date: Re: Floating point issue in sbcl 1.0.10?
- Previous by thread: Re: Floating point issue in sbcl 1.0.10?
- Next by thread: Re: Floating point issue in sbcl 1.0.10?
- Index(es):
Relevant Pages
|
|