XOR - The magical bitwise operatorby@maazrk
142,537 reads

XOR - The magical bitwise operator

March 1st 2021
3m
by @maazrk 142,537 reads
tldt arrow
EN
Read on Terminal Reader
Read this story w/o Javascript

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

@maazrk

Maaz

Receive Stories from @maazrk

react to story with heart

RELATED STORIES

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