Click here to Skip to main content
15,919,479 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Calculating Megabytes from ULONG Pin
Richard Andrew x6421-Nov-11 9:11
professionalRichard Andrew x6421-Nov-11 9:11 
GeneralRe: Calculating Megabytes from ULONG Pin
jkirkerx21-Nov-11 10:07
professionaljkirkerx21-Nov-11 10:07 
GeneralRe: Calculating Megabytes from ULONG Pin
David Crow21-Nov-11 10:30
David Crow21-Nov-11 10:30 
GeneralRe: Calculating Megabytes from ULONG Pin
jkirkerx21-Nov-11 10:53
professionaljkirkerx21-Nov-11 10:53 
GeneralRe: Calculating Megabytes from ULONG Pin
jkirkerx21-Nov-11 11:09
professionaljkirkerx21-Nov-11 11:09 
AnswerRe: Calculating Megabytes from ULONG Pin
CPallini21-Nov-11 9:50
mveCPallini21-Nov-11 9:50 
GeneralRe: Calculating Megabytes from ULONG Pin
jkirkerx21-Nov-11 10:09
professionaljkirkerx21-Nov-11 10:09 
AnswerRe: Calculating Megabytes from ULONG Pin
Chuck O'Toole21-Nov-11 14:48
Chuck O'Toole21-Nov-11 14:48 
You have asked the eternal question that will plague normal people and engineers until the end of time.

How Big Is 1K?

Normal people will say 1K = 1000, engineers will say 1K = 1024.

However, what if I told you the units were dollars? Why is it that nobody is confused if I say $1K?

Computer people use 1K = 1024, 1M = 1024*1024, 1G = 1024*1024*1024, etc. This is because they are used to using computer terminology where everything is a power of 2.

Everybody else, including Hard Disk manufacturers use the standard metric system definition of 1K = 1000, 1M = 1000*1000, and 1G = 1000*1000*1000.

So, if you ask Microsoft how big the file is, they will answer you using 1024 as the base, they are computer people. Also, hard drives are formatted into sectors that, regardless of the actual sector size, will contain 512 bytes of user data. So disk drive allocations will be expressed in powers of 2 simply because of this.

Finally, Performance Engineers will describe performance of computer systems using terms such as Megabytes per Second (MB/Sec) and that will be in base 10, 1000*1000 because, as a rate, you are talking about how much data is being moved, not the "chunk size" of the movement.

I am a computer software engineer doing performance work on disk drives. You can see I flip between numbering systems all the time. Keeps me on my toes.

And, by the way, this propensity of computer systems to use 1 Kilobyte to be 1024 has caught the attention of the international standards organizations that deal with Metric systems. As you'd expect, they are annoyed by computer people ursurping one of their definitons that has been around for a hundred years or so. So they have come up with new definitions for the stuff that's based on powers of 2, Kibibyte a "binary kilobyte".
http://en.wikipedia.org/wiki/Kibibyte[^]

So the eternal struggle continues
GeneralRe: Calculating Megabytes from ULONG Pin
jkirkerx21-Nov-11 15:57
professionaljkirkerx21-Nov-11 15:57 
GeneralRe: Calculating Megabytes from ULONG Pin
Stefan_Lang22-Nov-11 3:26
Stefan_Lang22-Nov-11 3:26 
GeneralRe: Calculating Megabytes from ULONG Pin
jkirkerx22-Nov-11 7:00
professionaljkirkerx22-Nov-11 7:00 
QuestionCScrollBar size Pin
Omar.Pessoa21-Nov-11 4:40
Omar.Pessoa21-Nov-11 4:40 
AnswerRe: CScrollBar size Pin
Randor 21-Nov-11 5:19
professional Randor 21-Nov-11 5:19 
GeneralRe: CScrollBar size Pin
Omar.Pessoa21-Nov-11 8:07
Omar.Pessoa21-Nov-11 8:07 
Questionmemset() run time error Pin
manju 321-Nov-11 1:23
manju 321-Nov-11 1:23 
AnswerRe: memset() run time error Pin
Benjamin Bruno21-Nov-11 1:42
Benjamin Bruno21-Nov-11 1:42 
QuestionRe: memset() run time error Pin
CPallini21-Nov-11 2:13
mveCPallini21-Nov-11 2:13 
AnswerRe: memset() run time error Pin
manju 321-Nov-11 2:19
manju 321-Nov-11 2:19 
QuestionRe: memset() run time error Pin
CPallini21-Nov-11 2:44
mveCPallini21-Nov-11 2:44 
AnswerRe: memset() run time error Pin
manju 321-Nov-11 18:30
manju 321-Nov-11 18:30 
GeneralRe: memset() run time error Pin
CPallini21-Nov-11 20:06
mveCPallini21-Nov-11 20:06 
AnswerRe: memset() run time error Pin
Chuck O'Toole21-Nov-11 3:52
Chuck O'Toole21-Nov-11 3:52 
GeneralRe: memset() run time error Pin
Erudite_Eric21-Nov-11 23:10
Erudite_Eric21-Nov-11 23:10 
AnswerRe: memset() run time error Pin
Stefan_Lang21-Nov-11 5:39
Stefan_Lang21-Nov-11 5:39 
GeneralRe: memset() run time error Pin
manju 321-Nov-11 18:31
manju 321-Nov-11 18:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.