3 ms·
If you just specify that a < INT_MAX/2 and b < INT_MAX/2, you are fine. If not (and you are providing a general purpose addition), then you need a big number l
by richardwhiuk 9y ago
If you just specify that a < INT_MAX/2 and b < INT_MAX/2, you are fine.
If not (and you are providing a general purpose addition), then you need a big number library.
- junke 9y agoYou can also overflow by adding two large enough negative numbers. /tmp/file.c:2:[kernel] warning: signed overflow. assert -2147483648 ≤ i+j; /tmp/file.c:2:[kernel] warning: signed overflow. assert i+j ≤ 2147483647; (tis-analyzer)