Versions Compared

Key

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

...

Code Block
signed int si1, si2, result;

signed long long tmp = (signed long long)si1 * (signed long long)si2;

/* 
 * If the product cannot be repesented as a 32-bit integer 
 * then handle as an error condition 
 */
if ( (tmp > INT_MAX) || (tmp < INT_MIN) ) {
  /* handle error condition */
}
result = (int)tmp;

...