Have you ever deleted a file from your hard drive and didn't see an increase in available space? Have you ever wondered why your computer seems to have less memory on it than the marketing guys told you?
Humans count by tens, 'cause we have ten fingers, but computers count by twos because they use on/off switches (binary). So we have a one's place, multiply by ten to get a ten's place, then by ten again to get a hundred's place etc.
10 = 1 * 10
100 = 1 * 10 * 10
1000 = 1 * 10 * 10 * 10
100 = 1
101 = 10
102 = 100
103 = 1000
Computers count in binary, so they have a one's place, multiply by two to get a two's place, x2 = four's place, x2 = eight's place, etc.
The bottom line is that 1024 is a round number in binary, not 1000, so:
1K = 1024
1M = 1024*1024 = 1048576
1G = 1024*1024*1024 = 1073741824
Another reason hard drives 'lose' space is because marketers want them to sound as large as possible.
A 40Gb drive should be 40*1024*1024*1024 = 42,949,672,960 bytes, but they're actually more like 40,000,000,000 bytes.
Also, there's some overhead on the disk for the computer to know where it stores files, the names of the files, etc, (the technical term is filesystem metadata) so you can't use the whole 40,000,000,000 bytes for storing files.