2 ms·
Or you could just convert from the unsigned to the signed type, rather than dragging unions into it. This conversion doesn't have undefined behavior; it produc
by kazinator 8y ago
Or you could just convert from the unsigned to the signed type, rather than dragging unions into it.
This conversion doesn't have undefined behavior; it produces an implementation defined result.
C programs can simulate two's complement math using unsigned types, avoiding UB. Then rely on IB to convert between signed and unsigned.