Re: Floating point issue in sbcl 1.0.10?
- From: Paul Khuong <pkhuong@xxxxxxxxx>
- Date: Tue, 30 Oct 2007 21:04:19 -0700
On Oct 30, 11:10 pm, D Herring <dherr...@xxxxxxxxxxxxxxxxxxx> wrote:
I'm gonna disagree with your claim; it feels like an error in how SBCL
prints floats. IEEE 754's single float has 24 (23+1 hidden) fraction
bits; log10(2^24)=7.2 digits.
So single floats have "7 decimal digits" of precision.
According to the paper you linked, 9 digits are required for perfect
reconstruction (pdf page 66, theorem 15).
How did SBCL and CLisp (and others?) end up printing 8 digits? Its
enough to be confusing, but not enough for reconstruction...
No, it is enough for reconstruction. 9 digits is a worst-case figure;
you obviously only need 1 digit to print 1 (1.0000...) perfectly.
These CL implementations only print just enough digits to accurately
reconstruct the numbers; that might even be explicitly specified in
the standard.
Paul Khuong
.
- References:
- Floating point issue in sbcl 1.0.10?
- From: steven . w . levine
- Re: Floating point issue in sbcl 1.0.10?
- From: Rainer Joswig
- Re: Floating point issue in sbcl 1.0.10?
- From: D Herring
- Floating point issue in sbcl 1.0.10?
- Prev by Date: Re: Learning Lisp in Linux?
- 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
|
|