Algorithmic conditions, and returns????

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
IcarusLives
Posts: 175
Joined: 17 Jan 2016 23:55

Re: Algorithmic conditions, and returns????

#16 Post by IcarusLives » 03 May 2018 16:55

aGerman wrote:
03 May 2018 15:06
But if what's in my head is correct, then XOR would return BOOL= 0 during this case.
Correct.

Code: Select all

set "XOR(b1,b2)=((b1+b2)&1)"
The least significant bit is 0 if the result of the addition was either 0 or 2.

But Batch already supports binary XOR, hence ...

Code: Select all

set "XOR(b1,b2)=(b1^b2)"
... would have been easier.

Steffen
Thank you very much for your help aGerman! I feel rather ignored that I forgot about this. I also appreciate the quick explanation :mrgreen:

Post Reply