0

With the file size given to me in MegaBytes (MB) I go ahead and convert it to Bytes:

in_MB = 999.991
in_KB = in_MB * 1024**2

The resulted value is: 1048566562.82

To verify my calculation is correct I navigate to Google Digital Storage Converter: and convert the calculated value in Bytes back to MegaBytes expecting to get the same input value I had: 999.991 MB. But surpassingly Google returns another value: 1048.56656282 MB instead of 999.991 MB.

Is there a mistake in my calculations?

enter image description here

2 Answers 2

2

Check out the difference between Mebibyte (1024*1024 Byte) and Megabyte(1000*1000 Byte).

your calculation is correct:
Google Digital Storage Converter

Sign up to request clarification or add additional context in comments.

Comments

1

You didn't make a mistake. Historically, memory and disk sizes were calculated using binary (base 2) numbers (2 ^ 20 or 1,048,576 bytes in a megabyte). Google is using the more recent decimal (base 10) representation of a megabyte (10 ^ 6 or 1,000,000) bytes.

>>> megabyte_size = 999.991
>>> bytes_size = megabyte_size * 2 ** 20
>>> bytes_size / 10 ** 6
1048.566562816
>>> bytes_size / 2 ** 20
999.991

Further reading:

https://en.wikipedia.org/wiki/Binary_prefix

3 Comments

Disk sizes haven't been measured in binary multiples for a very long time.
Mark: Hence my qualifier, historically. Perhaps it was my now fixed typo "are" instead of "were" that was confusing? The only reason I posted an answer and why I chose to include an example snippet was to draw the distinction between binary and decimal base. In other words, how Google arrived at their answer and why it was different. We are in violent agreement :)
I think I overreacted, I'm overly sensitive on this subject. I've just seen too many people who believe that disk sizes are somehow naturally specified in binary. These people then complain that the disk manufacturers misled them about the capacity of their new disk. This isn't helped by the fact that a particular popular OS still reports GB and TB as binary multiples, presumably to maintain backward compatibility to a time when floppy disks ruled.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.