Sorting floating-point values, and NaN
tn
no at email.com
Tue Nov 12 13:53:15 PST 2013
On Tuesday, 12 November 2013 at 21:09:34 UTC, Vladimir Panteleev
wrote:
> On Tuesday, 12 November 2013 at 21:03:03 UTC, tn wrote:
>>> assert((equiv(a, b) && equiv(b, c)) <= equiv(a, c));
>>>
>>> ("<=" on Booleans is actually implication.)
>>
>> Shouldn't the implication be to the other direction? Then it
>> becomes
>>
>> assert((equiv(a, b) && equiv(b, c)) => equiv(a, c));
>
> <= as in ≤ (less or equal), not ⇐ (reverse implies). <= can be
> used on booleans as "implies" due to the way it treats booleans
> as integers (true as 1, false as 0).
Thanks for the explanation. I thought it was pseudocode. That is
a horribly confusing trick.
More information about the Digitalmars-d
mailing list