Please rid me of this goto

Patrick Schluter via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 24 03:33:43 PDT 2016


On Friday, 24 June 2016 at 10:11:11 UTC, deadalnix wrote:
> On Friday, 24 June 2016 at 08:40:26 UTC, Patrick Schluter wrote:
>> On Thursday, 23 June 2016 at 20:01:26 UTC, deadalnix wrote:
>>> On Thursday, 23 June 2016 at 19:24:54 UTC, via Digitalmars-d 
>>> wrote:
>>>> On Thu, Jun 23, 2016 at 07:11:26PM +0000, deadalnix via 
>>>> Digitalmars-d wrote:
>>>>> | is bitwize or. || is binary or.
>>>>> & is bitwize and. && is binary and.
>>>>> ^ is bitwize xor. ^^ is... no, never mind.
>>>>
>>>> binary xor is.... !=
>>>>
>>>> lol
>>>
>>> 3 != 5 is true.
>>> 3 binaryxor 5 is false.
>>
>> He meant logical xor, because binary xor exists (^) and there 
>> would be no point to mention an equivalence.
>
> Still doesn't work.

It works if you cast each side of the comparison to boolean 
values (that's what logical and/or do implicitely, for != it has 
to be done explicitely as the operator has never been seen as 
logical xor).
in C (sorry I'm not fluent in D yet).
(bool)3 != (bool)5    or  old fashioned    !!3 != !!5 or after De 
Morgan transformation !3 == !5.



More information about the Digitalmars-d mailing list