Good day, dear!
Recently, reading various articles in Habré, I began to notice more and more that many authors still do not know anything about the ISO / IEC standards for binary prefixes (KiB = kibibyte, MiB = mebibyte, etc.) and constantly confuse them with SI prefixes (kB = kilobyte, MB = megabyte). Therefore, I decided to talk about it again in the hope that, after reading the article, a couple more people will start to use the standards!

Having departed from the topic, I want to say that, to be honest, due to lack of time, I never intended to write an article for Habr. I have always had enough read-only account to calmly read interesting articles for me and sometimes comment on VKontakte (yes, and there are quite a few adequate ones!). But the speck in the eye began to turn into a log, so I did donate one night to write this article.
Back in 1999, the IEC (International Electrotechnical Commission) adopted the international standard IEC60027-2 [IEC60027-2: 2005, ISO / IEC80000-13: 2008].
Through publications in various scientific journals about the new standard, he learned the world.

More than 13 years have passed since then, but unfortunately, due to the misuse of SI prefixes that have taken root in the older generation for writing data sizes, the confusion is not only still flourishing in the technical literature, but is also passed on to the younger generation.
')
Let's see what's the matter!
SI (Le Système International d'Unités) is an international system of units that describes not only units of physical quantities, but also defines so-called
standard prefixes :

As we see, the basic number system in SI is decimal, i.e. base 10.
In information technology, however, the binary number system is used, i.e. on the basis of 2. Convenience for the sake of, someone decided to use the prefix
kilo also for information units.
At that, the
kilo value was snatched from the SI, and either out of ignorance, or
distorted by malicious intent: out of 10
3 = 1000, 2
10 = 1024 were made
I agree that the difference is small and in the era
640K ought to be enough for anybody
it didn't bother anyone, but it was here that Pandora’s box was opened.
(By the way, K is an abbreviation for a temperature unit - Kelvin, and in this sense 640 Kelvin, which is approximately equal to +367 degrees Celsius, for any body just enough)With the development of information technology, more and more values appeared and the confusion became
more and more :
• Someone used kilos, mega, gig, etc. implying 1024
x (for example: 1MB = 1024x1024 B)
• Someone used kilos, mega, gig, etc. implying 1000
x (for example: 1MB = 1000x1000 B)
• Someone started using both in one system (for example: 1MB = 1024x1024 B, but at the same time 1Mbit / s = 1000x1000 bit / s)
• Someone began to invent something like KByte, MByte, GByte, etc. implying 1024
x• Sometimes they managed to mix everything up even in a single digit: so, given the size of a floppy disk, it was thought that 1MB = 1000x1024 B
• ... options became more and more
And what's the problem, you ask?
A simple example:
You buy a hard disk, on which 2TB is written.
Bring home, connect to a computer with Windows, and, not even having time to format, you see the size of 1.82 TB.
"Nakololi" - you think! And as much as 181 GB! And this is a whole cow as much as 10%!
What to do? Who pinned? To beat the face?
If you look at it objectively, it pricked you with Windows, more precisely Microsoft (
Apple would also pin it, so if you beat the face, then both ).
Why do they do it?
I asked a leading Microsoft employee: “Why do they hide in the standard setting of the file extension?”. To which he received the answer: “This is too difficult for users and not needed by them.”
Maybe this is the cause of confusion?
Quasi-monopolists Microsoft and Apple consider their customers to be
idiots by not-so-smart people, and therefore they are simply deceiving them !? Other reasons, I honestly do not see.
So let's look at the calculation:
2TB = 2x1000x1000x1000x1000 B ~ = 1.819x1024x1024x1024x1024 B = 1.819TiB
In this calculation, the dependence of the quantities is visible and it is clear where the figure came from in Windows, albeit with an incorrect abbreviation, and attentive ones (and who know about it) noticed a small letter i in TiB.
So, we finally again came to the international standard IEC60027-2, which in order not to destroy the
Earth, space and humanity, the system of values in physics, chemistry, etc. Defines binary prefixes (prefixes for binary multiples) specifically for IT:
physics.nist.gov/Pubs/SP330/sp330.pdf (§3.1, p. 34)
Compiling them according to the scheme:
SI-prefix binary (kilo binary, mega binary, giga binary etc) , we arrive at the following table:

Well, how simple?
And even if the pronunciation is kibibayt, mebibyte, gibibayt, tebibayt, etc. it is heard strange and clumsy, I think it's easy for everyone to use KiB, MiB, GiB, TiB, etc. in the lyrics !?
Everything seems new and unknown?
But the standard is already 13 years old!
(By the way, IPv6 is even older, but it still cannot enter it normally - it seems that because of the detrimental effect of large firms, standards have to lie for ten years and gather dust until some Apple comes, patents the letter i in KiB and MiB, and arranging a multi-million advertising campaign, will sell it as a new feature)But despite this, the standard has long been used in open products!
For example, in Linux, the standard is supported by the kernel itself.
But the screen with ifconfig'a

And why do I need it, you ask?
- First, GOST 8.417-2002 forces to work according to standards.
- Secondly, computer science is an exact science in which everything should be logical and almost everything is deterministic! And if you are really an IT pro, and do not want to appear like a schoolboy in the eyes of colleagues, then try to use the standard in your publications and programs, i.e. add i if you specify the size of the data for the base 1024.
Examples of using:

- Thirdly, the incorrect use of quantities can lead to very expensive consequences :
In this case, NASA lost the Mars Orbiter probe costing 125 MUSD (= 119.2 MiUSD) in September 1999, precisely because of problems in using the correct units of measurement!
- In addition, the use of incorrect spelling of data sizes “according to tradition” or because “that got used or convenient” is like saying: “a meter is nonsense, I will continue to measure distances with elbows, feet, fingers, tongue and other parts of the body "
And at the end I will give everyone a familiar joke:
A normal person thinks that in kilobytes there are 1000 bytes, and the programmer is sure that there are 1024 grams in a kilogram.
Therefore, I want you, IT pros, to urge:
Let good triumph over evil! Let's all become normal, put an end to the confusion and use the standards!
P.S. and for training (who wants to) - a small and easy task
(I didn’t see that the tasks on the habre were given, but for interactivity with the reader, I think it’s nice to offer something that is not completely difficult to warm up):You bought yourself a newest smartphone with support for fast LTE networks, which ideally develops up to 300 Mbit / s when downloading.
Thinking: “Now I will have something to do while sitting in a traffic jam for a job,” you concluded an unlimited tariff for mobile Internet.
On Wednesday evening, standing in a traffic jam, you were sent a link to a new video about how Putin, pretending to be a seal-leader, led a whole flock of seals to spawn, saving the whole flock from sharks along the way and fighting off the attacks of Somali pirates.
“What I need!” - you thought and decided to download the video.
Question: how many seconds will a 60 MiB video be uploaded if:
1. Though your provider sold you LTE tariff, but in traffic there is an average download speed of just-at the level of UMTS with HSDPA in the amount of 600 kB / s
2. When transferring each file, an overhead of 15% of the file size occurs.
3. Possible compression is not considered in this task.
UPD1From the version of MAC OS X 10.6, Snow Leopard shows correctly in SI units , so I ask you not to beat Apple for this
UPD2since there are a lot of questions about kbits and kibits, I’ll make a short summary here:
I tried to explain in the article and several times in the comments that kilo-, mega-, kibi-, mebi- (abbreviated k, M, Ki, Mi), etc. - these are just standardized prefixes that are attached to units of measurement (grams, bits, bytes, pixels, etc.)
- kilo means multiply by 1000, mega - by 1000 * 1000
- kibi means multiply by 1024, mebi - by 1024 * 1024
so for example:
8 kbit = 8 * 1000 bit, but 8 Kibit = 8 * 1024 bit
13 MPixel = 13 * 1000 * 1000 Pixel
256 MB = 256 * 1000 * 1000 B, but 256 MiB = 256 * 1024 * 1024 B
In addition, there is a suggestion to anyone who does not like to “beep” as an alternative to using the short form of the prefix in pronunciation, i.e. read kibayt, mibyte, gibayt, tibayt , etc.
In the standard, this is of course not, but if it spreads, then it will most likely be adapted.