[Cfp-interest 2918] FW: incorrect definitions of *_DECIMAL_DIG and DECIMAL_DIG

Mike Cowlishaw mfc at speleotrove.com
Mon Oct 16 05:24:25 PDT 2023


 
More from Michel:

-----Original Message-----
From: Michel Hack 
Sent: 15 October 2023 14:44

I have to take back the following, including my "suspicion":

| * Directed rounding in the same direction (up+up or down+down) for the
|   two conversions in a round-trip can change the value by one ulp for ...

Directed rounding in the same direction *WILL* change the value, for any
number of digits, unless the conversion is exact in both directions.

This is because with directed rounding the rounding error has the same sign
for each of the two conversions, and yet the sum of the two rounding errors
has to be zero. Duh! Sometimes the simplest explanation takes several days
to find.

For value-preserving up+down or down+up directed roundings the sum of two
rounding errors has to be zero, but this time it can work because they would
be of opposite signs. I'm still trying to nail down how many digits are
required for both rounding errors to be less than 1 in absolute value
(relative to an integral significand).

Note that, for to-nearest, the two rounding errors must not exceed 0.5, so
the constraint for directed rounding may actually be *less* stringent than
for to-nearest, not more stringent: perhaps one *fewer* digits is needed!
This is of course for up+down or down+up, i.e. opposite directions.

(Please communicate this embarrasing correction to the CFP...)




More information about the Cfp-interest mailing list