2 ms·
A way to grok the "+1" in "not, then +1" is, writing in binary: 10000 - x = 1111 - x + 1 = not(x) + 1 In other words, not(x)+1 in binary as the same as subtra
by tylerneylon 3y ago
A way to grok the "+1" in "not, then +1" is, writing in binary:
10000 - x = 1111 - x + 1 = not(x) + 1
In other words, not(x)+1 in binary as the same as subtracting x from the next higher power of two.
Lukas_Skywalker's fun note about doing this in base 10 made me realize that.