LOGBOOK

HELP

Quiz Entry - updated: 2026.07.07

What is the result of -1 >> 1 for a signed integer?

Still −1: arithmetic right shift fills the top with the sign bit (1), so all-ones stays all-ones.

-1 in binary: 11111111 (all 1s)
-1 >> 1:      11111111 (sign bit 1 fills in)
Result: -1

Explanation: When you arithmetic-shift a value of all 1s, you're filling with 1s, so it stays all 1s.

In general: -1 >> k = -1 for any k (as long as k < bit width).

From Quiz: REVE1 / Number Representations | Updated: Jul 07, 2026