> On Apr 15, 2016, at 9:52 AM, Stephan Tolksdorf via swift-evolution
> <[email protected]> wrote:
>
> but the documentation for Equatable and Comparable states that == and < must
> implement an equivalence relation and a strict total order, which is
> incompatible with the default IEEE-754 implementation of these operators when
> NaN values are involved. How do you resolve this conflict?
That’s a documentation bug; it should be relaxed by appending something like “…
on non-exceptional values.”
I’ll quote Dave A. to put it a bit more formally:
> To be clear, the semantic conformance of floating point types to Comparable
> depends on treating NaN as a "singular value”, i.e. outside the domain of
> valid arguments to < for the purposes of Comparable. That doesn’t mean we
> can’t nail down what < does for floating point types when it does get a NaN.
– Steve
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution