I know that XORing 2 decimal numbers mean that, they binary representations are XORed.
But what does it mean non-mathematical sense ?
What significance does it have?
If you XOR the result with one of the original numbers, you get the other original number.
a ^ b = X
X ^ a = b
X ^ b = a
This is used commonly in cryptography and hashing algorithms.
In simple words, the XOR of two decimal means, first converting the two decimals to binary and then performing the bit-wise XOR and then again converting the result to decimal.
Let's take an example,
Suppose we wanna find out what does 3^7
results? (where ^
is symbolising XOR operation)
Step 1 : Converting the numbers from decimal to binary
3 => 0011
and 7 => 0111
Step 2 : Taking the bit-wise XOR of the two binary numbers
3 : 0011
7 : 0111
3^7 : 0100
(hint : 1^0 = 1 and 1^1 = 0^0 = 0)
Step 3 : Convert the answer to decimal
0100 => 4
Hence, the 3^7 = 4
Click here for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With