[r6rs-discuss] Confusion over |p

From: Alan Watson <alan>
Date: Thu, 28 Jun 2007 13:58:07 -0500

Michael Sperber wrote:
> I believe it requires (b).

[F/X: Sharp intake of breath at the implications of this. Sounds of
someone throwing out David Gay's dtoa.c and reaching for a copy of
Burger & Dybvig.]

> I can't find any ambiguous wording on the
> subject--if you think it's ambiguous, please let me know where exactly
> so I can fix it.

I think my confusion stems from the use of "representation" in 4.2.8 for
two and possibly three different things. It means "the external written
representation" most of the time, but sometimes it means "the numerical
value corresponding to the external representation" (.e.g, in "x|p
represents the best binary floating-point approximation of x using a
p-bit significand") and sometimes it means "the internal low-level thing
used to hold the value" (e.g., in "should represent x|p using a p-bit
significand if practical").

I would suggest the following:

First, change "mantissa width" to "significand precision" in the grammer
and the text.

Then, use the following (in which I have not changed "mantissa width to
significant precision"):

"A number representation with nonempty mantissa width, x|p, represents
the value of best binary floating-point approximation of x using a
significand with p bits of precision. For example, 1.1|53 is a
representation of value of the best approximation of 1.1 with 53 bits of
precision (the same precision as normalized IEEE double-precision
numbers). An external representation of an inexact real number object
that contains no vertical bar should be treated as if specified with a
significand with 53 bits of precision."

"Implementations that represent real number objects internally using
binary floating-point numbers should represent x|p using a p-bit
significand if practical, or by a greater precision if a p-bit
significand is not practical, or by the largest available precision if p
or more bits of significand are not practical within the implementation.
Note that even if more than p bits of precision are chosen for the
internal representation, the value should be the best binary
floating-point approximation of x using a significand with exactly p
bits of precision."

You are aware that you have not specified a rounding mode, aren't you?
that is, does 0.75|1 round to 0.5 or 1.0?

Regards,

Alan
Received on Thu Jun 28 2007 - 14:58:07 UTC

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