On Sun, Jul 4, 2010 at 9:07 PM, jalaj jaiswal <[email protected]>wrote:

> how do we perform left shift and right shift on negative numbers..
>
> for eg  -1<<3
>
>        if negative number is shifted left (<<) then vacent space is
filled  by 0's
       and right sift (<<) then vacents space is filled by sign bits
    ex:
            -4 binary==   1 100
                      -4<<2
                 after left shift
                 1 10000 ==== -16

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to