Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using Objective-C to retrieve some information about the hard drive. I successfully retrieve the amount used in bytes.

However I am having trouble converting bytes to gigabytes. When doing this programatically, I get 76,768,641,024 bytes. I then convert this to GB: 76,768,641,024 bytes/(1024* 1024 * 1024) = 71.5 GB. My Mac reports the exact same amount of bytes. However it reports that this is equal to 76.77 GB!

Why is there a difference in GB if the amount of bytes is the same?

I am on a iMac running OSX Snowleopard.

share|improve this question
add comment

1 Answer

The difference is in your measurement. OSX is using the STANDARD measuring system.

1 GB (GigaBytes) = 1000 MB (MegaBytes)


The non-standard measurement used, for example, in Windows is:

1 GiB (GibiBytes) = 1024 MiB (MibiBytes)

http://en.wikipedia.org/wiki/Gibibyte

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.