• ### Announcements

#### Archived

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

# How many bytes in a megabyte?

## Recommended Posts

superpig    1825
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 on other sites
Alimonster    185
The second - there are 1024 bytes in a kilobyte, and 1024 kilobytes to a megabyte. So (1024*1024), in short.

##### Share on other sites
superpig    1825
OK, thanks. I thought the first was too neat to be right.

Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Enginuity1 | Enginuity2 | Enginuity3 | Enginuity4

##### Share on other sites
mputters    126
And you''re writing articles? hahah
Anyway :

K = 2^10
M = 2^20
G = 2^30
T = 2^40

etc...

##### Share on other sites
dagarach    169
Not since 1998.

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

##### Share on other sites
mputters    126
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 on other sites
dagarach    169
Nope:
1024 metres in a kibimetre.
1000 metres in a kilometre.
1024 bytes in a kibibyte.
1000 bytes in a kilobyte.

##### Share on other sites
mputters    126
You''re the only one who cares about what that comission said about using Ki ;p

##### Share on other sites
Nervo    344
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 on other sites
Xgkkp    122
Quick Quiz! How many Meters in a Decameter?

##### Share on other sites
Nervo    344
Uhhh 2 squared?

King Henry Died Drinking Chocolate Milk..... Um, 10 then!

##### Share on other sites
dagarach    169
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 on other sites
Tyson    122
How many square furlongs in a hectare

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

##### Share on other sites
Nervo    344
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 on other sites
superpig    1825
quote:
Original post by mputters
And you''re writing articles? hahah

This is how I ensure they''re correct.

Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Enginuity1 | Enginuity2 | Enginuity3 | Enginuity4

##### Share on other sites
vanillacoke    122
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 on other sites
vanillacoke    122
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 on other sites
Thrump    169
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 on other sites
Nervo    344
Talk about going backwards with the PI deal. Like going backwards to when the Greeks used 3 as the value of PI.

##### Share on other sites
dagarach    169
vanillacoke: Absolutely right! The kilogram was an established standard before Babbage was a man.

##### 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 on other sites
ggs    166
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 on other sites
bop_z    122
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.

DrPizza    160
Mega = 1E6.

So one million.

##### Share on other sites
DrPizza    160
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.