Re: Sign of NaN
I don't think there is a conflict even in the recommended practice.
The intent is that NaNs which differ only in the sign bit are
for the purposes of 6.2. I.e., I disagree with the interpretation that
requirements in 6.2 include the sign.
In this respect, It is unfortunate the 6.3 comes after 6.2.
On Sep 15, 2008, at 4:17 PM, Stephen Canon wrote:
Both of the "requirements" in question are preceded by a
"should" (i.e. are not actually requirements, but rather recommended
practice). I don't believe that there's any problem here.
- Steve Canon
On Sep 15, 2008, at 12:06 PM, Fred J. Tydeman wrote:
6.2 Operations with NaNs
4th paragraph: For an operation with quiet NaN inputs, other than
maximum and minimum operations, if a floating-point result is to be
delivered the result shall be a quiet NaN which should be one of the
6.2.3 NaN propagation
1st paragraph: An operation which propagates a NaN operand to its
result and has a single NaN as an input should produce a NaN with the
payload of the input NaN if representable in the destination format.
6.3 The sign bit
1st paragraph: For all other operations, this standard does not
specify the sign bit of a NaN result, even when there is only one
input NaN, or when the NaN is produced from an invalid operation.
There is a problem when the "same" requirements are specified in two
or more places and they differ. I find the requirements in 6.2
include the sign) to be at odds with 6.2.3 and 6.3 (which exclude the
sign). I believe that 6.2 needs to be altered. One suggestion is to
add at the end of the sentence: (as further specified in 6.2.3 and
Fred J. Tydeman Tydeman Consulting
tydeman@xxxxxxxxx Testing, numerics, programming
+1 (775) 358-9748 Vice-chair of PL22.11 (ANSI "C")
Sample C99+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.