J3/05-119
Date: 4 Jan 2005
To: J3
From: Fred Tydeman
Subject: 2.0+2.0, x/5.0 vs x*0.2
NUMBER: F03/0040
TITLE: 2.0+2.0 and IEEE
KEYWORDS: IEEE-754, accuracy, transformation
DEFECT TYPE: ???
STATUS: For consideration
QUESTION:
For processors that use IEEE arithmetic, must 2.0+2.0 be 4.0?
May x/5.0 be transformed into x*0.2?
DISCUSSION:
1.4 (6) [2:4-5] has: "This standard does not specify: The
physical properties of the representation of quantities and the
method of rounding, approximating, or computing numeric values
on a particular processor." That has been used as the reason
why 2.0+2.0 is not required to be 4.0.
Section 14 [364:6-13] has: "If a scoping unit has access to
IEEE_DATATYPE of IEEE_FEATURES, within the scoping unit the
processor shall support IEEE arithmetic and return true from
IEEE_SUPPORT_DATATYPE(X) (14.10.23) for at least one kind of
real. Similarly, if IEEE_DENORMAL, IEEE_DIVIDE, IEEE_INF,
IEEE_NAN, IEEE_ROUNDING, or IEEE_SQRT is accessible, within the
scoping unit the processor shall support the feature and return
true from the corresponding inquiry function for at least one
kind of real. In the case of IEEE_ROUNDING, it shall return true
for all the rounding modes IEEE_NEAREST, IEEE_TO_ZERO, IEEE_UP,
and IEEE_DOWN." IEEE-754 specifies methods of rounding and
computing numeric values, and in particular, requires that
2.0+2.0 be 4.0.
So, does section 14 override the weasel words of 1.4(6)? If
not, should something along the lines of: "The requirements of
this section override 1.4(6)" be added to section 14?
Using IEEE arithmentic, x/5.0 and x*0.2 are not equivalent, so
the former may not be transformed into the latter. Does IEEE
arithmetic override 7.1.8.3 and Note 7.18 and prohibit that
transformation? If not, should something along the lines of:
"The requirements of this section override 7.1.8.3" be added to
section 14?
ANSWER:
EDITS:
All edits refer to 04-007.pdf.
SUBMITTED BY: Fred Tydeman
HISTORY: J3/05-119 m171 Submitted