[r6rs-discuss] Hashes in the number syntax

From: Marcin 'Qrczak' Kowalczyk <qrczak>
Date: Fri Nov 24 04:05:57 2006

Eli Barzilay <eli_at_barzilay.org> writes:

> A *proper* implementation of this should not be limited to this
> oversimplified "unspecified numerals" thing. In your example, the
> result is not in the [2770-2780) range, it should be [2772-2783), and
> if you can only represent uncertain digits, then it must be 27##.#.

The "Printing Floating-Point Numbers Quickly and Accurately" algorithm
by Robert G. Burger and R. Kent Dybvig can output "#". It's never
needed with default options though; the exponential notation can be
used to carry the same information, and Scheme provides no way to
disable exponential notation.

# doesn't mean that this digit is uncertain. It means that substituting
any digit here leaves the numbers in its uncertainty range. Otherwise
valuable information would be lost.

I'm not convinced that allowing # in numeric syntax is worth the effort.
It's only a crude approximation of uncertainty, and I haven't seen it
used in practice.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak_at_knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/
Received on Fri Nov 24 2006 - 04:05:47 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:00 UTC