[Issue 13663] Comparison of Tuples with floating point fields
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Dec 14 13:17:23 PST 2014
https://issues.dlang.org/show_bug.cgi?id=13663
Peter Alexander <peter.alexander.au at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |peter.alexander.au at gmail.co
| |m
--- Comment #1 from Peter Alexander <peter.alexander.au at gmail.com> ---
There is nothing that can be done here. For user defined types (e.g. Tuple),
comparison operators are converted to calls to opCmp, i.e.
a < b a.opCmp(b) < 0
a <= b a.opCmp(b) <= 0
a > b a.opCmp(b) > 0
a >= b a.opCmp(b) >= 0
For NaN vs NaN, the comparison is neither equal, less than, nor greater than.
There is nothing that opCmp can return to give the desired semantics.
--
More information about the Digitalmars-d-bugs
mailing list