3 ms·
> C++ integers are more like Z/nZ This is an widely-held misconception, but C++ signed integers are _nothing_ like Z/nZ. Unsigned integers are (except for divi
by stephencanon 5y ago
> C++ integers are more like Z/nZ
This is an widely-held misconception, but C++ signed integers are _nothing_ like Z/nZ. Unsigned integers are (except for division), and machine arithmetic often is, but in the C++ abstract machine, signed overflow is undefined behavior.
- vlovich123 5y agoThe snippet on Twitter uses unsigned.
- stephencanon 5y agoYes, it does.