J3/17-129
To: J3
From: Malcolm Cohen
Subject: IEEE rounding modes badly described
Date: 2017 February 11
1. Introduction and discussion
The description of the rounding mode IEEE_AWAY is incorrect. This is
supposed to be what 60559 calls roundTiesToAway; that is, it rounds to the
nearest representable value, with ties rounding away from zero.
Furthermore, our description of IEEE_NEAREST is incomplete; it states that
it rounds to nearest, but not that it rounds ties to the even value, i.e.
that it is the what 60559 calls roundTiesToEven.
Finally, we say that
"...60559 specifies fives possible modes for rounding:
- IEEE_NEAREST ..."
which is completely wrong. 60559 does not specify ANY rounding mode which
it calls IEEE_NEAREST (or IEEE_UP etc.).
This needs to be completely rewritten, so that we use the 60559 terms for
the rounding modes (which it calls rounding-direction attributes - unlike
the 1970s version, it does not in principle have to be a "mode"), and
state directly what our parameter names correspond to.
It is arguable that we should use the 60559 terms throughout when we are
talking about the rounding modes, sorry rounding-direction attributes,
instead of our PARAMETER names. However, this paper does not advocate
that.
2. Edits to 17-007
[451:4] 17.4 The rounding modes, p2,
"five possible modes for rounding"
->"five possible rounding-direction attributes (the corresponding
named constant for the rounding mode in IEEE_ARITHMETIC appears
after the ISO/IEC/IEEE 60559:2011 attribute name in
parentheses)".
{That's what 60559 specifies. We could establish the correspondence
between the 60559 attribute names and the IEEE_ARITHMETIC named constants
in a separate table or a separate sentence or two, but listing them in
parentheses seems adequate.}
[451:5] same paragraph, first bullet,
"IEEE_NEAREST" -> "roundTiesToEven (IEEE_NEAREST)",
after "nearest representable value"
insert ", choosing the one with the least significant bit even if
there are two such values".
[451:6] same paragraph, second bullet,
"IEEE_TO_ZERO" -> "roundTowardZero (IEEE_TO_ZERO)".
[451:7] same paragraph, third bullet,
"IEEE_UP" -> "roundTowardPositive (IEEE_UP)".
[451:8] same paragraph, fourth bullet,
"IEEE_DOWN" -> "roundTowardNegative (IEEE_DOWN)".
[451:9] same paragraph, fifth bullet (IEEE_AWAY) replace entirely with
"roundTiesToAway (IEEE_AWAY) rounds the exact result to the nearest
representable value, choosing the one with larger magnitude if there
are two such values".
[451:9+] same paragraph after the bullet list, append sentence
"ISO/IEC/IEEE 60559:2011 requires support for IEEE_AWAY only for decimal
floating-point, it is optional for binary floating-point."
{This reads slightly better as a separate sentence.}
Making the whole paragraph read (infinity signs replaced by "Inf"):
"ISO/IEC/IEEE 60559:2011 specifies five possible rounding-direction
attributes (the corresponding named constant for the rounding mode
in IEEE_ARITHMETIC appears after the ISO/IEC/IEEE 60559:2011
attribute name in parentheses):
- roundTiesToEven (IEEE_NEAREST) rounds the exact result to the
nearest representable value, choosing the one with the least
significant bit even if there are two such values;
- roundTowardZero (IEEE_TO_ZERO) rounds the exact result towards zero
to the next representable value;
- roundTowardPositive (IEEE_UP) rounds the exact result towards +Inf
to the next representable value;
- roundTowardNeagative (IEEE_DOWN) rounds the exact result towards
-Inf to the next representable value;
- roundTiesToAway (IEEE_AWAY) rounds the exact result away from zero
to the next representable value.
ISO/IEC/IEEE 60559:2011 requires support for IEEE_AWAY only for
decimal floating-point, it is optional for binary floating-point."
===END===