29 April 2018

Definition of KB changed

Being an old-school programmer I learned 1KB == 1024 bytes, however this has been changed back in 1998. The prefix K (kilo) now means 1000 not 1024: 1 kilo byte is 1000 bytes. The why is discussed at physics.nist.gov and of course wikipedia.

The latest GB32 update displays the size of the created EXE (Gll or Lg32) after it has been written to disk. The number of KB is calculated as filesize / 1024. However, the value should have added the KiB unit, rather than the KB unit. The KiB unit denotes a value divided by 1024, KB doesn’t. If the file size is to be displayed in the KB unit it should have been divided by 1000.

I became aware of this when I noticed the Explorer displayed a different size for the compiled file. The next update will fix this by displaying the correct value in KB, so filesize /1000.


  1. Anonymous29/4/18

    According to Wikipedia, I KB (with an uppercase K) = 1000 and 1 kB (with a lowercase k) = 1024.
    Explorer displays file sizes with KB but should use kB: this is a Windows problem.

  2. Anonymous29/4/18

    Explorer displays a 1024 byte file as 1 KB instead of 1 kB.