+ 11
How does | and ^ work?
5 odpowiedzi
+ 11
thanks guys.
it seems like a challenge to do this mentally though.
+ 9
@Karlxu I used to find << and. >> to be tough,
but I don't have a problem with those these days.
Let me work on the | and ^ also.
Thank you all for your assistance,
you have been very helpful!
+ 2
@Susan O yeah, do it on mobile a bit hard. also have other operator >> and <<
+ 2
or, alternatively, you could talk about sets, in that case: | is the union operator: {1,2,3}|{2,3,4}={1,2,3,4}
^ is the symmetric difference operator. It gives you the elements of the first set that are not in the second, union the elements in the second set that are not in the first: {1,2,3}^{2,3,4}={1,4}
+ 1
first need covert decimal number to binary, then do logic compute bit by bit.