opCmp, [partial/total/pre]orders, custom floating point types etc.
John Colvin via Digitalmars-d
digitalmars-d at puremagic.com
Tue Jan 12 10:47:43 PST 2016
On Tuesday, 12 January 2016 at 18:36:32 UTC, Ilya Yaroshenko
wrote:
> On Tuesday, 12 January 2016 at 18:27:15 UTC, John Colvin wrote:
>> Background:
>> Some important properties for binary relations on sets that
>> are somewhat similar to the normal ≤/≥ on the real numbers or
>> integers are:
>>
>> [...]
>
> http://dlang.org/phobos/std_math.html#.cmp ? --Ilya
That doesn't solve the whole problem, because std.math.cmp isn't
the default comparator you can't use a totally ordered float type
as a drop-in for the builtin float types.
A more interesting question it bring up though is:
does the approach of imposing a (somewhat arbitrary) total order
work for other types where you would normally use a less "strict"
ordering? Does it work well for missing data representations?
More information about the Digitalmars-d
mailing list