For a 32-bits
signed integer, the maximum [positive] value is
(1 << 31) - 1
(because
1 << 31
represents the minimum [negative] value), or
2 147 483 647
.
For a 32-bits
unsigned integer, the maximum value is
(1 << 32) - 1
(minimum value being 0), or
4 294 967 295
.
Similarly:
For a 64-bits
signed integer, the maximum value is
(1 << 63) - 1
(because
1 << 63
represents the minimum [negative] value), or
9 223 372 036 854 775 807
.
For a 64-bits
unsigned integer, the maximum value is
(1 << 64) - 1
, or
18 446 744 073 709 551 615
.
Maybe this will help you understanding binary shifting operations:
Arithmetic shift - Wikipedia[
^]