Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

sign extension

Widening a signed number by copying its sign bit into the new upper bits, so its value stays the same.

Sign extension from n to m bits (m > n) fills bits n..m-1 with bit n-1, preserving the two's-complement value.

Examples

  • Widening the 8-bit −3 (0xFD) to 32 bits copies the sign bit: 0xFFFFFFFD, still −3.

Read the full section →