Y
Hacker News
new
|
ask
|
show
|
jobs
by
jonsen
3412 days ago
1110 + 1111 = 1101 1101 - 1110 = 1111 1101 - 1111 = 1110
Overflow doesn't matter if you just want to swap.
2 comments
Sacho
3412 days ago
(Assuming two's complement arithmetic, as amelius pointed out - I don't know if all programming languages and platforms use it)
link
mcintyre1994
3412 days ago
That's a really smart observation I hadn't made, thanks for explaining!
link