...
Code Block | ||
---|---|---|
| ||
signed int si1, si2, sum; if (((si1>0) && (si2>0) && (si1 > (INT_MAX-si2))) || ((si1<0) && (si2<0) && (si1 < (INT_MIN-si2)))) { /* handle error condition */ } sum = si1 + si2; |
...
...
Code Block | ||
---|---|---|
| ||
signed int si1, si2, sum; if (((si1>0) && (si2>0) && (si1 > (INT_MAX-si2))) || ((si1<0) && (si2<0) && (si1 < (INT_MIN-si2)))) { /* handle error condition */ } sum = si1 + si2; |
...