...
Code Block | ||
---|---|---|
| ||
int si1, si2, sresult; if ( (si1 < 0) || (si2 < 0) || (si2 >= sizeof(int)*CHAR_BIT) || (si1 > (INT_MAX >> si2)) ) { /* handle error condition */ } else { sresult = si1 << si2; } |
...
...
Code Block | ||
---|---|---|
| ||
int si1, si2, sresult; if ( (si1 < 0) || (si2 < 0) || (si2 >= sizeof(int)*CHAR_BIT) || (si1 > (INT_MAX >> si2)) ) { /* handle error condition */ } else { sresult = si1 << si2; } |
...