If the promoted type of the left-hand operand is int, only the five lowest-order bits of the right-hand operand are used as the shift distance. It is as if the right-hand operand were subjected to a bitwise logical AND operator & (�15.22.1) with the mask value 0x1f. The shift distance actually used is therefore always in the range 0 to 31, inclusive.

According to the last part of the paragragh, by using -1 etc, you're out of range. By the rest of the paragragh, here's my best guess at what's happening: 8 << -1; 8 will be an int, so only the rightmost 5 bits of -1 will be used 1 = 00001 1s complement = 11110 2s complement = 11111 so we have 11111 = -1 apply the & operator with a mask of 1f (or 11111) 11111 &11111 ______ 11111 as an unsigned number 11111 = 31. so by "8 << -1" you're asking for a left shift of 31 places. int 8 = 00000000 00000000 00000000 00001000 (32 bits) Bits shifted off either end are lost, so you're left with a bunch of 0s. You could >> a negative number, by -1, then you'd fill the entire thing with the sign bit (which is 1 in a negative number) resulting in -1. But that would be confusing to anyone reading your code. "8 << -1" looks like your saying "shift 8 left 1 backwards", if that's really what you want, use 8 >> 1. Last note: You got output on 8 << -5 because -5 will resolve to 11, so the one 'on bit' didn't shifted off the int. hth [ August 15, 2003: Message edited by: Ray Stojonic ]