← #TIL

Use 16 384 instead of 16 000

·1 phút đọc·#habit

Why?

Selected powers of two(Hằng đẳng thức đáng nhớ)

  • \Large b^2 = 256: The number of values represented by the 8 bits in a byte.
  • \Large b^2 = 1 024: The binary approximation of the kilo-, or 1,000 multiplier, which causes a change of prefix. For example: 1024 bytes = 1 kilobyte. This number has no special significance to computers, but is important to humans because we make use of powers of ten.
  • \Large b^2 = 4 096: The hardware page size of an Intel x86-compatible processor.
  • \Large b^2 = 32 768: The number of non-negative values for a signed 16-bit integer.
  • ……

So?

  • You need to partition your hard drive: 200Mb? No. Use 256Mb
  • You need define your password: 123123123? No. Use 18446​744​073​709​551​616

Ref:

Note này hắn lấy từ GitHub issue qua.