On Wed, 23 Sep 2009 01:53:31 -0500, John Cowan <[email protected]> wrote:
> Since R3RS, Scheme has had notation for specifying more than one > precision > of inexact numeric constants. R4RS standardized the current notation > of replacing the normal E of exponential notation with the flags S > (short), F (single), D (double), and L (long), and most Schemes support > all these syntaxes. However, all Schemes I can find provide, in fact, > only one precision (which I conjecture to be IEEE double in all cases), > so all these flags are useless to programmers. I propose that they be > dropped in R7RS. I'm curious about why no Scheme provides IEEE single floats. It doesn't seem to be an intrinsically Scheme design decision, and as you point out all extant Common Lisp implementations provide them. Would any implementors care to comment? > Common Lisp has the same notation, but most Common Lisps provide two > precisions, with S = F = E = IEEE single and D = L = IEEE double. > The only exception is CLisp, which does floating point in software and > actually does provide four precisions: immediate, IEEE single, IEEE > double, and arbitrary-precision. When an exact number must be converted > to inexact in CL, it is always in F precision. I believe that Peter Graves' in-development XCL (http://www.armedbear.org/) also provides CLisp-style arbitrary-precision floats via MPFR (http://www.mpfr.org/). > (I determined these facts by setting five variables to high-precision > constants -- in fact, pi to 1000 digits -- each with a different exponent > flag, and then seeing which numbers, if any, were = to which others.) > > In particular, unless an implementer is willing to provide CLisp-style > software, immediate floats are a bad idea. They inevitably have fewer > bits than IEEE, and just chopping those bits to 0 quickly rather than > properly rounding introduces so much error that the results are useless. I don't understand why you say this; it's perfectly possible to provide immediate IEEE single floats on a 64-bit host, and I believe that 64-bit Common Lisp implementations commonly do. -- Brian Mastenbrook [email protected] http://brian.mastenbrook.net/ _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
