caipengbo / LeetCode

Algorithms Exercise: LeetCode Problems, LeetCode Weekly Contest etc.
https://github.com/caipengbo/LeetCode-CPP
56 stars 17 forks source link

字节数字大小的估算 #5

Open caipengbo opened 5 years ago

caipengbo commented 5 years ago

2^10 = 1024 10^3 = 1000 1个int = 4个字节 32位,去掉一位符号位,31位,2^31 = 2(2^30) ≈ 2 (10^9)