java - What is arithmetic left shift of 01001001? -
java - What is arithmetic left shift of 01001001? -
i think 00010010 i.e. tries maintain sign bit is
on other hand, logical left shift 1 pos 10010010
is correct?
for left shift, arithmetic , logical shift same.
the difference right shift only, arithmetic right shift re-create old msb new msb after having shifted, keeping negative number beingness converted positive when shifting.
wikipedia has more detailed explanation.
java bit-manipulation
Comments
Post a Comment