paint-brush
XOR - The magical bitwise operatorby@maazrk
142,761 reads
142,761 reads

XOR - The magical bitwise operator

by Maaz3mMarch 1st, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow
EN

Too Long; Didn't Read

The magical bitwise operator - XOR - provides new approaches you never knew existed to solve a particular problem. In this article, we will discuss about the magical powers of XOR bitwise. XOR returns 1 only if exactly one bit is set to 1 out of the two bits in comparison ( Exclusive OR) The only way you can totally understand how the above solution is working is by trying it out for different binary numbers on a piece of paper. The biggest hint you have is you can do it using ( ^ ) operator. To solve this problem, you need to know a property of binary subtraction.

Company Mentioned

Mention Thumbnail
featured image - XOR - The magical bitwise operator
Maaz HackerNoon profile picture
Maaz

Maaz

@maazrk

L O A D I N G
. . . comments & more!

About Author

Maaz HackerNoon profile picture
Maaz@maazrk

TOPICS

Languages

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite