posted 23 years ago
As you may know
>> - signed right shift(divide by 2)
>>> - unsigned right shift
<< - signed left shift(multiply by 2)<br /> <br /> >> - This operator shifts the bits to the right 1 by 1 and
Shifted off bits are lost(discarded) and 0 is brought
into the left(higher order bit).
For a negative number the sign remains and 1 is brought
into the left.
Note: Shifting -1 to the right always results in -1
<< - This operator shifts the bits to the left 1 by 1 and<br /> higher order bit which is shifted out is lost(discarded)<br /> and a 0 is brought into the right<br /> <br /> >>> - This operator shifts the bits to the right 1 by 1 and
higher order bit which is shifted out is lost and a 0
bit is brought into the right (for both +ve and -ve nos.)
Note: This operator always returns +ve value for -ve
values also
This is a brief explanation. If you really want to understand these operators , then you need to work out applying these operators for different type of values
If you have any doubts on a particular topic then you go to search in this top of the forum and type the related topic , you will get lot of answers that were discussed in this forum(just a suggestion).
thanks..
[This message has been edited by sdev (edited August 15, 2000).]
"SCJP5 | SCWCD5| DEVELOPER"