[Tutor] << operator ? [left bitwise shifting]

Erik Price erikprice@mac.com
Thu, 11 Apr 2002 00:03:19 -0400


On Wednesday, April 10, 2002, at 05:07  PM, Danny Yoo wrote:

> (32 bits)  So left shifting it once shoves the leftmost zero out into
> space, and moves everything else one place to the left.
>
>     2 == "00000000000000000000000000000010"
>
> And it turns out that when we left shift a number, it effectively
> "doubles".
>
>
> Hope this is making some sort of sense... *grin* Please feel free to ask
> more questions about this.

Having seen the bitwise shift operator but having no idea what it was 
for, I appreciate this and the other explanations given here on the list 
(even though it wasn't me who asked the question... thanks Prahlad!).

But now I'm just curious what it's for -- why you would use it?  Just to 
double numbers?  And if that's the case, then what's the right bitwise 
shift operator for?


Erik