Wednesday, 7 June 2017

RIGHT AND LEFT SHIFT

RIGHT SHIFT:

Shift one bit to the left;

Ex;

N=1000=8
>>1=0100

2^1*N=RIGHT SHIFT
N=number
1=shift value that is how many time shift

LEFT SHIFT:


shift one bit to right

Ex:

N=0101=5
1<<=1010

N/2^1=LEFT SHIFT
N=number
1=shift value that is how many time shift