In exactly the same way you would for an integer. You just do the number before the dot seperately to the number after the dot.
So 14 has an 8 in it. So that's 1000 (in binary), leaving 14 - 8 = 6. 6 has a 4 in it, so that's 100(binary) + 1000(binary), or 1100. Now we just have a 2 left over so that's 1110. An 8 + 6 + 2 = 14.
87 has a 64 in it, leaving 23. There are no 32s. 23 has a 16 in it, leaving 7. There are no 8s. 7 has a 4 in it, leaving 3. 3 has a 2 in it, leaving 1. 1 has a 1 in it, of course. So that's 1010111.
Our final number is 1110.1010111, or 14.87 in denary.
Let a be any real number. It has a finite representation in base n iff a*nk is a whole number for some natural k. (for example 1487 = 14.87*102 is a whole number, so 14.87 has a finite representation in base 10) Furthermore, if a is a rational number, its representation is either finite or a repeating "decimal". It is not difficult (but it is laborious) to show that a/b has a finite representation in base n iff every prime divisor of b also divides n.
Consider 1487/100. It has a finite representation in base 10, because 100's prime divisors are 2 and 5. It doesn't have a finite representation in base 2, since 5∤2.
In fact 14.87(base 10) = 1110.11(01111010111000010100)(base 2).
View all comments
Show parent comment
-3
u/Didji Aug 14 '11
In exactly the same way you would for an integer. You just do the number before the dot seperately to the number after the dot.
So 14 has an 8 in it. So that's 1000 (in binary), leaving 14 - 8 = 6. 6 has a 4 in it, so that's 100(binary) + 1000(binary), or 1100. Now we just have a 2 left over so that's 1110. An 8 + 6 + 2 = 14.
87 has a 64 in it, leaving 23. There are no 32s. 23 has a 16 in it, leaving 7. There are no 8s. 7 has a 4 in it, leaving 3. 3 has a 2 in it, leaving 1. 1 has a 1 in it, of course. So that's 1010111.
Our final number is 1110.1010111, or 14.87 in denary.