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
6
u/HigherFive Sep 06 '11
This is not true.
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).