3 ms·
Fractions, or the rationals are equivalent to polynomials. The rationals are also in aleph-naught, and thus have a one to one and onto mapping to the natural nu
by nyrikki 3y ago
Fractions, or the rationals are equivalent to polynomials. The rationals are also in aleph-naught, and thus have a one to one and onto mapping to the natural numbers.
Floating point numbers are equivalent to rationals with their base as the denominator
I. base-2 rationals with denominators that are powers of 2 will have termination expansions.
Useful for storage but not arithmetic as Fraction(147/10) has 10 in the denominator and 5 is a prime factor that isn't in the base.
BPD, or Binary Packed Decimal also allows for the storage of 14.7
But once again not useful for arithmetic.
Accumulated errors, catastrophic cancelation, etc are real problems too.
In decimal, 1/3 can be stored exactly but the expansion is 3
33333...
Because 3 is prime and not a prime factor of 10.
Had we decided on something rather than 10 for our base it may have worked out for computers better, but it is what it is.
The rationals are nice, being the only countable, totally ordered sets. But producing a computer circuit that can perform arithmetic on them isn't practical as far as I know without using fixed radix and the associated problems with non-terminating expansions.