Versions Compared

Key

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

...

Left-Shift Operator

The left-shift operator is between two operands of integer type.

...

Code Block
bgColor#ccccff
unsigned int ui1, ui2, uresult;

/* Initialize ui1 and ui2 */

if ( (ui2 >= sizeof(unsigned int)*CHAR_BIT) 
  || (ui1 > (UINT_MAX  >> ui2))) ) { 
{
  /* handle error condition */
}
else {
  uresult = ui1 << ui2;
}

...