
29 Sep
2012
29 Sep
'12
1:21 a.m.
AMDG On 09/27/2012 07:29 AM, Andrew Sutton wrote:
For instance, axiom EqualityComparable::Reflexivity states that some (rather than every) objects must compare equal to themselves. If you consider type float, objects with value NaN (not-a-number) compare unequal.
No; all well-formed values of a type can be compared for equality (if the type is EqualityComparable). NaN is not a well-formed value. It is literally *not a number*.
Unless you mean to say that any program that uses a NaN in any way has undefined behavior, this notion of a "well-formed value" seems arbitrary and capricious. In Christ, Steven Watanabe