Consider the decimal number 11.37510. We already know that the binary value of 11 is 10112. Now we need to find the binary number for the fractional part 0.37510. The steps below show how to convert this number to binary using repeated multiplication.
![]()
|
|
||
|
|
||
|
|
We can also organize this conversion in table form as we did with the previous one.
0.375 * 2 = 0.75 (leftmost digit) 0.75 * 2 = 1.5 0.5 * 2 = 1.0 (rightmost digit) |
This time we read our answer of 0.0112 from top to bottom since the first multiplication gives us the most significant digit, and the last multiplication gives us the least significant digit.
|
1011.0 + 0.011 1011.011 |
It is important to note that many decimal fractions do not have an exact representation in binary. For example, when we convert the decimal fraction 0.110 to binary, our answer looks like this:
0.00011001100110011001100...
Notice how this binary fraction repeats infinitely. Since we cannot represent some fractions exactly in binary, we cannot perform exact arithmetic with fractions. You may not realize it, but your computer actually has very tiny amounts of error in its computations. You rarely see these errors because the binary approximations are very close to the exact decimal value. However, when programmers write programs which perform many mathematical computations, they must consider this error to ensure their answers are reliable.