question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SI standard should be default

See original GitHub issue

I noticed that the project defaults to base-2 calculations using the JEDEC “standard”, which is arguably the worst of both worlds.

Firstly and most importantly, 96% of the world (and science within the US) uses the metric system (SI) regularly, where the prefixes kilo-, mega-, etc. all have universal and precise meanings: thousand, million, etc. As such, most of the world understands what these prefixes mean and would expect them to mean the same thing when it comes to bits and bytes, and rightly so: because that is indeed what they mean. JEDEC, however, calls for the unit names and symbols to be represented as if they are SI-based, but actually defines them differently (e.g., kilobyte and KB mean 1024 bytes, etc.). This is deceptive, and has been the basis for much confusion and even lawsuits.

To fix this once and for all, the IEC has come up with different names and symbols for the base-2 units. Most operating systems, wisely, switched everything over to SI units. In fact, about 70% of the devices of the world use SI prefixes for everything but RAM by default; Windows is the only unfortunate holdout. Since most people in the world are familiar with the SI and are not in the esoteric field of memory in computer science, they expect SI units. So it’s a bit ironic to refer to the package as a way “to get a human readable file size” when it only caters to 30% of the humans of the world.

To add to the confusion, regardless of JEDEC or SI, most contexts where bits would be used are related to networking, where the prefixes mean the SI definition (base 10) almost always anyway! This can be considered a bug at the moment where the package calculates bits using base-2 by default as well, which is inappropriate in most use cases.

Please change the default to base 10 and remove JEDEC completely; if people want to use base-2, they have the option to do so with the IEC standard, but it at least wouldn’t lie to them about what they’re seeing. I understand that this would be backwards-incompatible, so bumping to another major version is to be expected, but I think it’s important and worth it.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
avoidworkcommented, Aug 2, 2021

Re-opened; on sabbatical atm so I’ll be slow to respond.

1reaction
avoidworkcommented, Jul 24, 2021

Now I understand where you’re coming from; I have the same response when I hear “decimate” used incorrectly due to MCU.

I reopened the ticket; if you want, make a PR to change it to IEC as default, or SI. I don’t have a strong opinion, I’m interested in the least issue drama from such a change. I’d wager IEC is the change that people will accept.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Default Unit Settings (Imperial vs. Metric) - Simio Forum
Is there a way to have the Unit Setting default as Imperial vs. Metric when starting a new model or creating a new...
Read more >
Should I use only SI units of measurements in review papers?
And of course, yes, use the SI units. Nowadays all non-SI units are defined in terms of SI units. However, don't trust random...
Read more >
Defining the standard electrical units (article) | Khan Academy
SI is based on the metre-kilogram-second system (MKS). In the United States, the SI is used in science, medicine, government, technology, and engineering....
Read more >
SI Units - Mass | NIST
The primary standard of mass for this country is United States Prototype Kilogram 20, which is a platinum-iridium cylinder kept at NIST.
Read more >
Dimensions, Units, Conversion Factors, and Significant Digits
By default, an integer has an infinite number of significant digits. · The number of significant digits is determined by the overall accuracy...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found