3 ms·
I am not talking about numbers in R. I am talking about representing numbers from Q in a decimal fraction. (Or in a fraction to basis 11 or 12 or 60 etc.) (I
by eru 4y ago
I am not talking about numbers in R. I am talking about representing numbers from Q in a decimal fraction. (Or in a fraction to basis 11 or 12 or 60 etc.)
(I'm not sure why anyone would want to bring up R? Why R and not eg p-adic numbers? Or algebraic numbers?)
General case: your fraction p/q will be expressed as some repeating decimal fraction, like 22/7 = 3.|142857 (where | marks the start of the repeat.)
Special case: your fraction p/q will be expressed by a decimal fraction that stops. Like 2/5 = 0.4 or so.
You can't get rid of the general case. No matter what base you pick, the representation of the vast majority of your fractions will have infinite repeats.
You can however minimize the occurrences of the special case by picking a base with fewer divisors.
In contrast, picking a base with more divisors, like 12 or 60 gives you more special cases to worry about.
(And yes, you can apply the trick you suggested, to sort of remove the special case by writing 0.4 as 0.3|9. Or for that matter as 0.4|0; but I'm not sure that last one buys you anything.)
Just to be clear: this is all a bit tongue in cheek and just talking about what system is mathematically more elegant, by having fewer special cases. In practice, having more divisors is convenient; though in practice just rounding after some number of digits is also fine.