4 ms·
The problem with implicit wrap-around of unsigned integer is that it makes your program slower. The underlying hardware with 2s complement does not need to pay
by matu3ba 5y ago
The problem with implicit wrap-around of unsigned integer is that it makes your program slower.
The underlying hardware with 2s complement does not need to pay the cost of reserving the overflow space or shifting/masking it out.
Further more, its more consistent if signed and unsigned behaving identical than having to look for the type with integer promotion rules of the number.
If you prefer the current C/C++ way of less performance and inconsistency that is fine.