Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Google says that 4MB = 4,000,000 bytes [duplicate]

Tags:

byte

I thought that 4MB would be 4 * 1024 * 1024 = 4,194,304 Bytes, but Google says that it is 4,000,000 Bytes. Is there a different interpretation?

Well, according to the maximum transfer size for Win7 bulk endpoint, I need to allocate 4MB of memory. Would this be 4,194,304 or 4,000,000?

like image 723
Nazar Avatar asked Sep 02 '15 15:09

Nazar


1 Answers

Yes, the International System of Units says that M means “106”, not “1,024 × 1,024”. Additionally, there's the ISO/IEC 60027-2 which says that Mi means “220”.

You could try “how many bytes in 4MiB” in Google to get a totally different result.

Microsoft often uses the SI units for powers of two, so 4MB probably means 4MiB, so “4,194,304”.

Actually, the binary prefixes system (ki, Mi…) is not that old: it was approved by the IEC only in 1998. People used to work with powers of two way before that, and used the traditional SI units prefixes for that. It's not uncommon to see it used that way even today.

like image 102
Arkanosis Avatar answered Oct 11 '22 07:10

Arkanosis