Archived

This topic is now archived and is closed to further replies.

superpig

How many bytes in a megabyte?

Recommended Posts

Is it 1000000 (1000*1000) or 1048576 (1024*1024)? Or rather, if I wanted to allocate blocks of around 1mb each, which size should I use? I guess OS memory managers might prefer one over the other... Superpig - saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Enginuity1 | Enginuity2 | Enginuity3 | Enginuity4

Share this post


Link to post
Share on other sites
quote:
Original post by dagarach
Not since 1998.

Since then, there have been 1000000 bytes in a megabyte and 1000 bytes in a kilobyte.


Yup, and 1024 meters in kilometer.

Share this post


Link to post
Share on other sites
Then how come my computer's hard drive like everyone elses computes using a base 2 to multiple powers of ten to show hard drive space. How come when an adveriser says a hard drive at "80 Gigabytes" I notice it is closer to "75 Gigabytes"? Surely it is plain to see computers don't use base 10 computation and that the OP was correct in his assertion.

EDIT: I see your point Dagarach, you are correct also, its just that no one seems to fall in line with it.

Here is an excerpt from a website glossary:

kilo- (k-) [2]
in measuring the memory of a computer, the prefix kilo- often means 2^10 = 1024 instead of 1000. By a 1998 resolution of the International Electrotechnical Commission, the new prefix kibi- (Ki-) should replace kilo- for 2^10. However, this doesn't seem to be happening. ROOFLES!!




[edited by - nervo on August 6, 2003 7:18:12 AM]

Share this post


Link to post
Share on other sites
Don''t come crying to me when your Mars probe crashes from a 24 byte buffer overrun.

I don''t care really, but the current system can be confusing. Hard drive sizes in gigabytes are normally power-of-ten gigas (IIRC), but other storage media normally use power-of-two kilo and mega. Thus leading to the problem that you can''t fit 1024 megabytes of data into 1 gigabyte of space on a hard-drive (you can''t even get 1000 in).

The next nasty situation you can get into is when the method changes across a step. Such that a gigabyte an one system might become 1024 * 1000.

Share this post


Link to post
Share on other sites
How many square furlongs in a hectare

============================
A guy, some jolt, and a whole lot of code

Share this post


Link to post
Share on other sites
Thats hard and stuff. What are the conversions?

BTW Dagarach you aren''t wrong at all as it appears you support the decisions of that convention but programmers are still like alot of people in that many resist change!

Share this post


Link to post
Share on other sites
Does anyone know what the advantage was supposed to be to using powers of 10 for K,M,G? It seems to me like whoever decided that doesn''t know how computers work...

Share this post


Link to post
Share on other sites
Does anyone know what the advantage was supposed to be to using powers of 10 for K,M,G? It seems to me like whoever decided that doesn''t know how computers work...

Share this post


Link to post
Share on other sites
quote:
Original post by vanillacoke
Does anyone know what the advantage was supposed to be to using powers of 10 for K,M,G? It seems to me like whoever decided that doesn''t know how computers work...


It reminds me of that state that decided PI should equal 3 to make things easier.

Share this post


Link to post
Share on other sites
Talk about going backwards with the PI deal. Like going backwards to when the Greeks used 3 as the value of PI.

Share this post


Link to post
Share on other sites
quote:
Original post by Thrump
It reminds me of that state that decided PI should equal 3 to make things easier.


Great story...Here''s a reference for it. The most relevant quote, from the bottom:

"In 1897 the Indiana House of Representatives unanimously passed a measure redefining the area of a circle and the value of pi. (House Bill no. 246, introduced by Rep. Taylor I. Record.) The bill died in the state Senate."

So, it never actually became law, but hey, they tried.

-Odd the Hermit

Share this post


Link to post
Share on other sites
quote:
Original post by Nervo
Talk about going backwards with the PI deal. Like going backwards to when the Greeks used 3 as the value of PI.

No the Ancient Greeks were mroe advanced than that. They defined PI as ~22/7 (~3.14) which is good to 2dp.


quote:
Original post by dagarach
vanillacoke: Absolutely right! The kilogram was an established standard before Babbage was a man.


He is talking about [u]using[/u] base powers of 10 with computers, not who the hell estabilish the base power of ten names/symbols (heck, there are 2 different versions for the names of the various powers of tens...)

Share this post


Link to post
Share on other sites
In the beginning there were machines which could transfer only 8 bits at a time so people decided to create a new unit called byte (8 bits). Because of the obvious similarity between scientific units - like kilo - and those new derivatives they decided to name the new units likewise as they may be more self-explanatory to most of the people in that way.

Share this post


Link to post
Share on other sites
quote:
Original post by Nervo
Then how come my computer''s hard drive like everyone elses computes using a base 2 to multiple powers of ten to show hard drive space. How come when an adveriser says a hard drive at "80 Gigabytes" I notice it is closer to "75 Gigabytes"? Surely it is plain to see computers don''t use base 10 computation and that the OP was correct in his assertion.

EDIT: I see your point Dagarach, you are correct also, its just that no one seems to fall in line with it.

HD manufacturers clearly have done.

Share this post


Link to post
Share on other sites