Explain >>> in details?

 DevX Home Today's Headlines   Articles Archive   Tip Bank   Forums

# Thread: Explain >>> in details?

1. ken Guest

## Explain >>> in details?

Could you help me to explain the concept >>> in details? Thanks!

2. Lisa Guest

## Re: Explain >>> in details?

>
>Could you help me to explain the concept >>> in details? Thanks!

3. bhupesh Guest

## Re: Explain >>> in details?

"ken" <kzhao@calltrol.com> wrote:
>
>Could you help me to explain the concept >>> in details? Thanks!

any decimal no can be represented in binary format
decimal base is 10 & hence has 10 integers from 0 to 9
binary is a very old system which was employed by 1st generation computers
whose base is 2 & uses 2 nos. 0 & 1
any program in whatsoever language is converted to binary language called

machine level language before compiling by computer itself

say any no 14
following is the way to convert decimal to binary
14/2 quotient=7 remainder=0
7/2 3 1
3/2 1 1
1/2 0 1
read remainder in reverse order 1110
now viceversa(bin-->dec)
say 1110
(0*2exp0)+(1*2exp1)+(1*2exp2)+(1*2exp3)
=0 +2+4+8
=14
now for byte 14
00001110>>>1 means digits r shifted to 1 position right as
00000111=7
>>> is called unsigned shift because always 0 is added at most significant

bit(msb)
while >> is signed shift
(it adds 0 if msb is 1 & 1 if msb is zero
e.g.
00011011>>1 ans= 00001101