On Tuesday, 12 November 2013 at 19:39:19 UTC, Vladimir Panteleev
wrote:
On Tuesday, 12 November 2013 at 19:26:12 UTC, tn wrote:
Thus, the correct solution would be to modify the functions to
take "lessOrEqual" as a template parameter instead of "less".
Too late for that now... just like it's too late to change IEEE
comparison logic.
Yes, I was expecting this. :)
If "less" is kept, then we need another template argument to
separate equality and incomparability (something like
"equals(a,b)", or "incomparable(a,b)").
Is this to allow generic partial ordering (rather than to fix
sorting NaNs specifically)? I remember seeing a thread about
partial ordering and opCmp:
http://forum.dlang.org/post/[email protected]
I had generic partial orderings in my mind too, but I think it is
also needed for user defined floating point types such as
bigfloat. (Unless "isnan" function is defined for the bigfloat
type too and detected automatically.)