[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Re: Halfway cases for binary-to-decimal conversion in IEEE 754-1985
Interesting observation. A few years ago I checked the AIX conversion
routines (which claim 754-1985 conformance), and reported a couple of
exact half-way cases within the required-to-be-correctly-rounded range
that rounded the wrong way. Perhaps they were conforming after all?
However, when I read clause 4.1 (Round to Nearest) in 754-1985, I don't
come to the same conclusion as you do. Yes, it states parity in terms
of the least-significant bit, and it explicitly mentions the values at
the edge of the binary representable range. But ten is an even base,
so "least-significant bit" is unambiguous, and the edge cases simply
don't apply in 754-1985 binary->decimal conversions, for two reasons:
(a) the decimal exponent range is effectively unbounded, and (b) the
edge of the range would be way outside the correctly-rounded range.
Clause 4.1 does not say "for radix two only", though one could infer
this from the fact that only one radix is discussed. In other respects
the situation is pretty much the same as in 754-2008, where clause 4.3.1
(corresponding to the old 4.1) was also written with *machine* numbers
in mind, and not decimal character strings. Nevertheless (except for
the p=1 case, discussed last month), the interpretation for decimal (and
hexadecimal) strings is pretty clear.
Michel.
---Sent: 2009-04-09 16:35:35 UTC