RE: MS-FO-LC1-102: NaN and distinct-values

> Section 15.1.11: The wording of this is quite contrary to
> IEEE 754, which states: "Every NaN shall compare unordered 
> with everything, including itself."  However, based on the 
> semantics and least-surprise factor, returning only one NaN 
> is probably the right thing to do.  May want to consider 
> rewording text though, such as "Although NaN does not compare 
> equal to itself, multiple NaN values are returned only once 
> for the purpose of this function."

Or one could say "two values are defined to be distinct unless

(a) they are comparable and equal, or
(b) they are both NaN"

(Note, this treats non-comparable values as distinct rather than treating
them as an error).

Michael Kay

Received on Wednesday, 9 July 2003 07:06:16 UTC