Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ccccff
signed int si1, si2, sum;

/* Initialize si1 and si2 */

if (((si1>0) && (si2>0) && (si1 > (INT_MAX-si2)))
 || ((si1<0) && (si2<0) && (si1 < (INT_MIN-si2)))) {
   /* handle error condition */
}
else {
  sum = si1 + si2;
}

...