bug-gnulib
[Top][All Lists]
Advanced

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

Re: external floating-point representations


From: Bruno Haible
Subject: Re: external floating-point representations
Date: Sun, 23 Apr 2017 03:09:22 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-72-generic; KDE/5.18.0; x86_64; ; )

Hi Paul,

> Perhaps this is because I am a fan of shorter, more-intuitive numbers. You can
> blame me for the fact that in Emacs the double-precision floating-point number
> closest to 0.1 displays as "0.1" rather than as the more-precise but uglier
> "0.10000000000000001".

Likewise, in Lisp culture, this kind of shorter external representation of
floating-point is used:
- In Common Lisp, it is specified by the standard [1]. The goal to use as few
  digits as possible is implicit.
- Likewise, in Scheme, it is specified by the standard [2].
- Some schemers even thought it was worthwhile to write a paper about their
  implementation of this specification. [3].

Bruno

[1] https://www.cs.cmu.edu/Groups/AI/util/html/cltl/clm/node187.html
    "reading a printed representation produces an object that is ... equal to
     the originally printed object."
[2] 
http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-9.html#%_sec_6.2.6
    "... is expressed using the minimum number of digits ..."
[3] http://www.cs.indiana.edu/~dyb/pubs/FP-Printing-PLDI96-abstract.html




reply via email to

[Prev in Thread] Current Thread [Next in Thread]