On Oct 5, 2001 at 08:41, praveen shinde wrote:
Applying the right shift operator in c to a number and
shifting it right by a single digit is equivalent to dividing that numer by 2.But if the number is negative then it is not equivalent.how come? please give me information about the books in which i can find an explaination.
I'm guessing that when you right shift, the number is padded on the left by 0s. So your number becomes positive. I don't know what you mean by "not equivalent". Is this it? please post some source and output.