Quiz Entry - updated: 2026.07.14
What are the minimum and maximum values for signed and unsigned integers?
Unsigned: 0 to 2^w − 1. Signed (two's complement): −2^{w−1} to 2^{w−1} − 1 — the negative side reaches one further than the positive.
For w-bit integers:
| Type | Min | Max | Pattern Min | Pattern Max |
|---|---|---|---|---|
| Unsigned | 0 | 2^w - 1 | 000...0 | 111...1 |
| Signed | -2^{w-1} | 2^{w-1} - 1 | 100...0 | 011...1 |
Common values (32-bit):
UINT_MAX: 4,294,967,295 (2³² - 1)INT_MAX: 2,147,483,647 (2³¹ - 1)INT_MIN: -2,147,483,648 (-2³¹)
Asymmetry: |TMin| = |TMax| + 1 (there's one more negative than positive)