When the difference between two numbers is equal to their xor
Answers
Answered by
0
No.
If x=2n+1x=2n+1 and y=2ny=2n, then a=b=1a=b=1, but there is no way to determine nn.
It is easy to cook up more examples, if you arrange that you don't need to any "borrowing" (is that the correct English term?) when you do paper and pencil subtraction in base two. When that happens, subtraction gives the same result as XOR, but you cannot recover the positions of the cancelled bits.
If x=2n+1x=2n+1 and y=2ny=2n, then a=b=1a=b=1, but there is no way to determine nn.
It is easy to cook up more examples, if you arrange that you don't need to any "borrowing" (is that the correct English term?) when you do paper and pencil subtraction in base two. When that happens, subtraction gives the same result as XOR, but you cannot recover the positions of the cancelled bits.
Similar questions
Physics,
7 months ago
Social Sciences,
7 months ago
Hindi,
7 months ago
World Languages,
1 year ago
Math,
1 year ago
Math,
1 year ago