Bug 209314

Summary: Reconsider WTF:KB, WTF::MB, WTF::GB
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: Web Template FrameworkAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: mcatanzaro
Priority: P2    
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   

Description Michael Catanzaro 2020-03-19 15:24:44 PDT
We have, in StdLibExtras.h:

static constexpr size_t KB = 1024;
static constexpr size_t MB = 1024 * 1024;
static constexpr size_t GB = 1024 * 1024 * 1024;

That's actually KiB, MiB, and GiB. We should call them KiB, MiB, and GiB, not KB, MB, GB. KB would be 1000 (10^3). MB would be 10^4. GB would be 10^5.

This isn't pedantic, it's something that's important to be precise about since there's a big difference between the units. It can be extremely confusing when precision is required and the units are not as expected.

E.g.:

https://duckduckgo.com/?q=500+GB+to+GiB&ia=answer
https://en.wikipedia.org/wiki/Orders_of_magnitude_(data)
Comment 1 Michael Catanzaro 2020-03-19 15:26:51 PDT
(In reply to Michael Catanzaro from comment #0)
> MB would be 10^4. GB would be 10^5.

This will live on the internet forever to embarrass me. Yes, that's not how math works. MB is 10^6 and GB is 10^9....