Re: Floating point issue in sbcl 1.0.10?



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

.



Relevant Pages

  • Re: float bug? perl 5.8, DBI and oracle 10.2.0
    ... precision numbers in oracle, you've got 38 decimal digits to play ... and with minimal coaxing perl will handle them as ... digits from a 32 bit floating point number - I'll go out on a limb ... and hazard that one can expect 12 or so digits from a 64 bit floating ...
    (perl.dbi.users)
  • RE: float bug? perl 5.8, DBI and oracle 10.2.0
    ... I would not characterise 32-bit signed integers as giving 10 digits ... truncate and tell people you get 9 digits of precision. ... perl 5.8, DBI and oracle 10.2.0 ... Floating point values are typically stored in 64 bits or sometimes 96 ...
    (perl.dbi.users)
  • Re: float bug? perl 5.8, DBI and oracle 10.2.0
    ... I would not characterise 32-bit signed integers as giving 10 digits ... truncate and tell people you get 9 digits of precision. ... perl 5.8, DBI and oracle 10.2.0 ... Floating point values are typically stored in 64 bits or sometimes 96 ...
    (perl.dbi.users)
  • Re: 15 Significant Digits Limitation a Mistake for Spatial Informa
    ... DP does not restrict to 15 decimal digits. ... Input and output precision are more tightly linked in Excel ... Decimal data type or roll your own extended precision data types. ...
    (microsoft.public.excel)
  • Re: Salamin-Brent algorithm
    ... fraction-representing digits, which is of course ... might have thought one could dispose of because ... since one's precision is so increasing with the ... S-B algorithm)? ...
    (sci.math)