Yes you could do everything as a rational.
Thing about fractions is that you end up doing quite a lot of work finding hcf of the denominators.
An indefinite precision decimal fixed point arithmetic would, essentially, be an "bigrat", but all denominators would be powers of 10. That would mean, of course, that 1/3 would have a "representation" error -- but we are at least used to that.
The advantage of a fixed (but large) precision decimal floating point would be that functions like exp() and log() etc. (which do appear in financial calculations) would be more straightforward... as would any arithmetic involving widely different scales of numbers. You have to understand the effect of rounding...
Now that I've looked, I see that there is Math::BigFloat which is decimal (though that small fact doesn't exactly leap out at you). I see it is implemented using BigInt for the significands, and allows quite fine control over the precision. So I'll go away now.
|