Binary fractions is probably the bit you are missing. Let's see if I can explain.
You most likely know integer binary – you start with 1, the value to its left is double that (2) and the value to the left is double that (4) and so on.
Now imagine that your number has a binary point (a binary version of the decimal point).
Again starting with 1, the value to its right is half that (0.5) and the value to the right of that is half again (0.25) and so on (0.125) and so on (0.0625)...
Now imagine that you only have 24 bits to store your number (0.6) in, and that the binary point is at the far left.
Start like so:
24 - 0.5
23 - 0.25
22 - 0.125
21 - 0.0625
20 - 0.03125
19 - 0.015625
18 - 0.0078125
17 - 0.00390625
16 - 0.001953125
15 - 0.0009765625
14 - 0.00048828125
13 - 0.000244140625
12 - 0.0001220703125
11 - 0.00006103515625
10 - 0.000030517578125
09 - 0.0000152587890625
08 - 0.00000762939453125
07 - 0.000003814697265625
06 - 0.0000019073486328125
05 - 0.00000095367431640625
04 - 0.000000476837158203125
03 - 0.0000002384185791015625
02 - 0.00000011920928955078125
01 - 0.000000059604644775390625
Now the job is to use these numbers to get 0.6 by either adding or ignoring each number as you go along. Every time you add a number write down a 1 and every time you ignore a number, write down a 0.
0.5 + 0.0625 + 0.03125 + 0.00390625 + 0.001953125 + 0.000244140625 + 0.0001220703125 + 0.0000152587890625 + 0.00000762939453125 + 0.00000095367431640625 + 0.000000476837158203125 + 0.000000059604644775390625 ... and then we run out, with a total value of 0.599999964237213134765625. We couldn't get to 0.6 with the level of precision available to us.
Now let's map that back to your issue:
- Your chosen number was 0.6, so I used that too
- The number 24 is one greater than the number of bits available within the floating point format for the fractional part of the representation. In IEEE754 format (used by Intel processors), bit 24 is always assumed to be set, so doesn't need to be stored and therefore using 23 bits of the storage, not 24.
- One bit is used for the sign (1 = negative).
- 8 bits are left over to represent how much and which way to shift the binary point. For 0.6, no shift is required.
Does that help explain? If needed I can provide you with an OpenOffice spreadsheet that will help you understand how numbers from 0.5 to 1 are represented, or with a little more work on it, I think I can get it to handle any number within the normal float range.