int opEquals(Object), and other legacy ints

Deewiant deewiant.doesnotlike.spam at gmail.com
Sun Jul 30 00:16:30 PDT 2006


Walter Bright wrote:
> Stewart Gordon wrote:
>> Walter Bright wrote:
>>> I can. (a == b), where a and b are ints, can be implemented as (a -
>>> b), and the result is int 0 for equality, int !=0 for inequality.
>>
>> How is this (a == b) rather than (a != b)?
> 
> I don't understand your question.

(a - b), if a and b are equal ints, evaluates to 0, which is generally
considered to mean false. So isn't (a - b) actually a way of finding (a != b),
instead of (a == b)?



More information about the Digitalmars-d-bugs mailing list