2^(x+y) = 2^x * 2^y
2^10 ~ 1,000
2^20 ~ 1,000,000
2^30 ~ 1,000,000,000
2^40 ~ 1,000,000,000,000
(etc.)
2^1 = 2
2^2 = 4
2^3 = 8
2^4 = 16
2^5 = 32
2^6 = 64
2^7 = 128
2^8 = 256
2^9 = 512
So, 2^31 (signed int max) is 2^30 (about 1 billion) times 2^1 (2), or about 2 billion. And 2^32 is 2^30 * 2^2 or about 4 billion. This method of approximation is accurate enough even out to around 2^64 (where the error grows to about 15%).
If you need an exact answer then you should pull up a calculator.
Handy word-aligned capacity approximations:
- 2^16 ~= 64 thousand // uint16
- 2^32 ~= 4 billion // uint32, IPv4, unixtime
- 2^64 ~= 16 quintillion (aka 16 billion billions or 16 million trillions) // uint64, "bigint"
- 2^128 ~= 256 quintillion quintillion (aka 256 trillion trillion trillions) // IPv6, GUID