How many bytes per GB?

Discussion in 'macOS' started by John Musbach, Aug 17, 2008.

  1. John Musbach macrumors regular

    Joined:
    Nov 8, 2007
    #1
    Mac OS X says 46.82GB = 49,995,766,983 bytes but Google says: 49 995 766 983 bytes = 46.5621864 gigabytes. :confused: Does the way Mac OS X counts GB's per byte differ from that of Google or is my filesystem fubar'd (Disk Utility reported no issues)?
     
  2. Aea macrumors 6502a

    Aea

    Joined:
    May 23, 2007
    Location:
    Denver, Colorado
    #2
  3. John Musbach thread starter macrumors regular

    Joined:
    Nov 8, 2007
    #3
    Ohhh, so Mac OS X is reporting in GiB and Google is literally reporting in GB?

    EDIT: Doesn't look like that's it: 49 995 766 983 bytes = 46.5621864 gibibyte :confused:
     
  4. Aea macrumors 6502a

    Aea

    Joined:
    May 23, 2007
    Location:
    Denver, Colorado
    #4

    49995766983/pow(1000,3) = 49.995766983 GB
    49995766983/pow(1024,3) = 46.562186426483095 GiB

    Sorry, read the question in haste due to me being tired. The difference is likely based on file block allocations, size on disk will (almost always) be larger then the size of the data stored. I'm guessing you did a calculate size on an entire directory, so the extra disk use compounds with every file, etc :)

    TLDR: Your OS is fine, it's normal :)
     
  5. Chundles macrumors G4

    Chundles

    Joined:
    Jul 4, 2005
    #5
    There should be 5,000,000,000 bytes in a gigabyte. Anything less or more is not 5 gigabytes.

    46.82GB SHOULD be 4,682,000,000.000 bytes but stupid people who originally named 1024 bytes a "kilo" byte wrecked it for everyone.
     
  6. John Musbach thread starter macrumors regular

    Joined:
    Nov 8, 2007
    #6
    Oh ok I see, thanks. :) I confirmed the same behavior on two different computers, one running Leopard and another Tiger so indeed this seems normal behavior. (and yep you guessed it, this resulted from getting the total size of a folder)
     
  7. kntgsp macrumors 6502a

    Joined:
    Jul 27, 2004
    #7
    Well Google is doing it correctly with the information given.

    49,995,766,983 / 1024^3 (Binary value for Giga) gives 46.5621864.

    Math doesn't lie.

    and 46.82GB(GigaBytes) in Bytes is 50,272,592,200, using 1024^3. Even if you use decimal instead of binary (1000^3), you get 46,820,000,000 not 49,995,766,983.

    So I dunno what to tell you. It could be that OSX is calculating the bytes available. It could be every so many bytes are reserved for some write, causing it to report less that there are.. I dunno. You'd have to ask someone more familiar with the inner workings of OSX.
     
  8. kntgsp macrumors 6502a

    Joined:
    Jul 27, 2004
    #8
    Aaaaand someone beat me to it.
     
  9. millar876 macrumors 6502a

    millar876

    Joined:
    May 13, 2004
    Location:
    Peterhead, Scotland UK
    #9
    Short answer - 1GB = 1,073,741,824
    Long answer; see below

    8 bits (b) = 1 Byte (B)
    1024 B = 1 kilobyte (KB)
    1000 B = 1 KiB

    The easiest way to think about it is 1024 is the binary number your computer uses to count hard drive capacity and 1000 is the decimal value hard drive manufacturers use to sell their hard drives because it makes the numbers look bigger. There is the exact same ammount of information, but, a 16 Gigabyte iPhone sounds a lot better from a marketing standpoint than a 14.9 gigabyte one (iPhone figure lower because the "about" screen dose not show space used by the iPhone OS, if somone with an iPhone wants to they can post the full capacity from iTunes)
     
  10. SC68Cal macrumors 68000

    Joined:
    Feb 23, 2006
    #10
    Base 10 numbering collides with Base 2 once again.
     
  11. John Musbach thread starter macrumors regular

    Joined:
    Nov 8, 2007
    #11
    Thanks for the replies everyone. :) My main concern was why the byte count was differing from the GB reported by Finder when checking the total size of a directory and Aea answered it nicely. Apparently (and the GUI doesn't make this too obvious) the GB reported is the size on disk while the bytes reported are size of data stored. I expected the byte and GB reported to correlate together like they do when checking the used space on a volume but for one reason or another it appears that that is not so when getting the total space used for a directory.
     
  12. Am3822 macrumors 6502

    Am3822

    Joined:
    Aug 16, 2006
    Location:
    Groningen, The Netherlands
    #12
    Now that the question has been answered, here's another view of the matter -- http://xkcd.com/394/

    (a bit out of place, I know, and yet)
     

Share This Page