3 ms·
The explanation for bitwise complement ignores the word-size which matters a lot here. For example ~4 = 251 in uint8, not 3 like in the example.
by remcob 9y ago
The explanation for bitwise complement ignores the word-size which matters a lot here. For example ~4 = 251 in uint8, not 3 like in the example.
- boomlinde 9y agoI don't think it is fair to say that it is ignored, rather it assumes three bits.
- norax 9y agoThis is a good point, thank you for bringing it up! I added a footnote about it: https://norasandler.com/2017/12/05/Write-a-Compiler-2.html#fn2 https://norasandler.com/2017/12/05/Write-a-Compiler-2.html#f...