[wp-trac] [WordPress Trac] #41366: WordPress makes uses of decimal prefix and uses binary multiplicator for constant memory size value

WordPress Trac noreply at wordpress.org
Wed Jul 19 11:55:57 UTC 2017


#41366: WordPress makes uses of decimal prefix and uses binary multiplicator for
constant memory size value
-------------------------+------------------------------
 Reporter:  sebm78       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:  close        |     Focuses:  ui
-------------------------+------------------------------
Changes (by jnylen0):

 * keywords:   => close


Comment:

 This is unlikely to change for a couple of reasons.

 1. Backwards compatibility (with both core and plugins - a quick scan
 shows around 1.3 million installs of plugins that use these constants)
 2. While no longer considered technically correct, this is commonly
 accepted usage in the computer industry.  From the linked Wikipedia
 article:

 > The computer industry has historically used the units kilobyte,
 megabyte, and gigabyte, and the corresponding symbols KB, MB, and GB, in
 at least two slightly different measurement systems. In citations of main
 memory (RAM) capacity, gigabyte customarily means 1073741824 bytes. As
 this is a power of 1024, and 1024 is a power of two (2^10^), this usage is
 referred to as a binary measurement.

 For future reference, it is also quite helpful to include a direct link to
 the code in the ticket description, like
 https://core.trac.wordpress.org/browser/tags/4.8/src/wp-includes/default-
 constants.php?marks=25-28#L8.  Note:

 - Linking to a specific released version rather than `trunk`, so that the
 line numbers won't change over time
 - Linking to a specific line number at the top of a section to provide
 context
 - Using `?marks=...` to highlight a section of the code

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41366#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list