[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Re: Halfway cases for binary-to-decimal conversion in IEEE 754-1985
Date: Thu, 9 Apr 2009 13:57:32 +0200
From: Vincent Lefevre <vincent@xxxxxxxxxx>
To: stds-754@xxxxxxxxxxxxxxxxx
Subject: Halfway cases for binary-to-decimal conversion in IEEE 754-1985
The IEEE 754-1985 standard (note: 1985, not 2008) does not seem to
specify how halfway cases should be rounded for binary-to-decimal
conversions in the round-to-nearest mode, in the ranges where
correct rounding is required. Indeed Section 5.6 (Binary <-> Decimal
Conversion) refers to Section 4 (Rounding), but the rounding of
halfway cases in round-to-nearest is specified only for a radix-2
target format.
So, does an implementation that rounds halfway cases away from zero
for binary-to-decimal conversions can be regarded as an IEEE 754-1985
comforming implementation (if everything else is OK)?
Or is this lack of specification regarded as a defect corrected by
IEEE 754-2008?
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
Neither.
Look more closely at the 1985 text & you will discover that
binary <--> decimal conversion is only required to be correct
to 1.5 ULPs. The reason for this is that efficient algorithms
were not yet known at the time.
But this hardly matters because the 1985 text was obsoleted
when the 2008 text was published.
The 2008 text specifies & requires correct rounding because
those algorithms have been around for some 2 decades now.
Both documents are correct for their times.
Dan
P.S. - A few minor errors & typos have been pointed out since
754-2008 was published last year. Mike Cowlishaw is keeping
a list at http://speleotrove.com/misc/IEEE754-errata.html.
Please check there for known errors.