Patricia said:
I would agree with this with two exceptions:
1. There are some financial calculations for which extreme exactness
does not matter, and having transcendental function approximations does.
For example, calculations of the form "How long will it take me to pay
off my home loan if I do X?".
Are there then integral methods for computing amortization schedules and the like?
My instinct for such, e.g., to calculate a monthly payment, is to calculate
the payment using double, convert to long, sum the payments over the term,
then add the rounding error to the final payment.
I did a contract for a major credit-card company a decade or so ago. They
used natural log formulas to calculate amortization. The formula they wanted
me to use included ln(x)^2 in the numerator and ln(x) in the denominator of a
fraction - same x. I simplified to just ln(x) in the numerator. My team lead
was seriously worried that I had screwed up the calculation, on which point I
assured her that I had. I forbore to mention they differed in the singularity.
They didn't use integer math to compute amortization quantities. I would bet
that they did accumulate round-off error into the last payment. I have
received payment schedules from consumer credit wherein the payments varied in
the penny. I guess some companies do use the hybrid approach - use double to
get the payment, convert to long to actually work with it.