When you do bitwise shift, digits which gone outside of "bounds" gets discarded. When you do right shif on signed numbers it might (implementation defined) fill empty slot which appears after we shifted digit from it with sign bit.
When you do right shift on signed numbers it might (implementation defined) fill empty slot which appears after we shifted digit from it with sign bit.
[quote]How about adding odd number of any (1 or 0), does the odd number influence?/quote]I didn't get the question, can you elaborate?
I want to warn again that sign bit expansion is implementation-defined behavior and it can vary even between different versions of one compiler. Generally you should not use bit shifts on signed numbers. Expecially negative numbers.