3 ms·
You cannot anymore. "There is One True Representation for signed integers, and that representation is two’s complement" (P0907R4)
by manwe150 4y ago
You cannot anymore. "There is One True Representation for signed integers, and that representation is two’s complement" (P0907R4)
- xscott 4y agoThis part is telling: > If a signed operation would naturally produce a value that is not within the range of the result type, the behavior is undefined. The author had hoped to make this well-defined as wrapping (the operations produce the same value bits as for the corresponding unsigned type), but WG21 had strong resistance against this. So, even within the standards group there are disagreements on the topic.