mtbc: maze I (white-red)
Mark T. B. Carroll ([personal profile] mtbc) wrote2024-11-21 05:24 pm
Entry tags:

Interest rate calculations

I was thinking how tricky interest rate calculations might be for institutions. One typically wants to quote an annual percentage but give interest more often than that. In terms of how the payments add up to the annual total, we certainly don't want that sum to be less than the quoted percentage but we would also rather it be as low as possible. Yet, when we pay interest, it's not like we pay exactly a twelfth root or whatever, or probably even calculate roots as precisely as we could, and we somehow round each payment to probably just a couple of places depending on the currency we're using. Further, absent withdrawals, the interest payments increase steadily due to compounding. In practice, I wonder how institutions deal with such payment calculations where each is rounded yet what matters is the sum of the payments.
armiphlage: Ukraine (Default)

[personal profile] armiphlage 2024-11-22 01:13 am (UTC)(link)
In Canada, it's mandatory that all interest rates be presented as an annual rate. So, "12% per annum, compounded monthly on the first of the month".

https://www.canada.ca/en/financial-consumer-agency/services/industry/commissioner-decisions/decision-55719-512Q304.html
armiphlage: Ukraine (Default)

[personal profile] armiphlage 2024-11-23 03:13 am (UTC)(link)
It's stored as floating point; they round to two decimal places when displaying on a screen, or when transferring between accounts or businesses. When paying out as cash, it is rounded to the nearest 5 cents:

https://www.canada.ca/en/revenue-agency/programs/about-canada-revenue-agency-cra/phasing-penny.html
thewayne: (Default)

[personal profile] thewayne 2024-11-22 06:08 pm (UTC)(link)
Interest and dates are tricky things, especially when programmers don't use standard libraries and think they can do better themselves.

I ran into a truly astounding situation a year or so ago. Someone I know who has a masters degree in teaching maths was trying to create their own formula for calculating monthly interest rates in Excel, and it wasn't quite right. They wanted me to look at it, and the numbers were truly wonky. I dig into the formula, and he was applying the APR MONTHLY! NOT dividing it by 12, as you would for a basic monthly interest rate calculation.

And this dude has a masters in teaching maths? Not to mention an extensive background in computers?!

Some people....
thewayne: (Default)

[personal profile] thewayne 2024-11-23 08:38 pm (UTC)(link)

Hoboy!  Hand-written crypto!  DEFINITELY not a good idea!  Excel is fine for general purpose stuff, but when people rely on it for serious stuff, trouble can ensue.  Like when messing with genetics, or when 15 and 15.0 are different.