TITLE: 32 bit representations and shifting
QUESTION [0 upvotes]: If 7 in 32 bit binary form is:
 00000000000000000000000000000111

I would like to perform right arithmetic shift (>>) by 16 so what would the binary representation look like then? I'm a bit confused on this.

REPLY [2 votes]: With each arithmetic shift right, the lowest bit falls off the end, the other bits move down one position, and the sign bit (0 here) propagates down. So after only 3 shifts, all bits are 0, and each of the remaining shifts result in zero as well. So: the result is 0 in every bit position.
{"set_name": "stack_exchange", "score": 0, "question_id": 2338867}