Considering all those early home computers, the ZX Spectrum, the Galaksija, the VIC-20, the Apple I/II/III, and all of those, they all have some 8-bit CPU which does integer arithmetic and no floating point. So these machines have some kind of floating point implementation in software.
My question is, why not use fractions? A fraction is just two numbers which, when divided by eachother, yields the number you are interested in. So picture a struct which holds one integer of whatever size, and one byte for each of divisor and dividend. And probably we all remember how to add or subtract fractions from school.
I haven't really calculated it, but it seems intuitive that the advantages over floating point would be:
- faster addition/subtraction
- easier to print
- less code
- easy to smoosh those values together into an array subscript (for sine tables etc)
- easier for laypeople to grok
x - x == 0
And the disadvantages:
- probably the range is not as large, but that's easy enough to overcome
- not as precise with very small numbers
It seems like such an obvious tradeoff (precision/speed) that I'm surprised I can't find any homecomputers or BASICs that did arithmetic in this way. What am I missing?