2 ms·
I ran into issues coding an interest calculator for personal usage when I realized that the length of a year is variable. My unit tests were failing because all
by faitswulff 6y ago
I ran into issues coding an interest calculator for personal usage when I realized that the length of a year is variable. My unit tests were failing because all the finance examples never explained how they dealt with time changing out from under the formulas they were using, and all the computer knew was Unix time.
I still don't exactly know how to handle this. If you start an account that compounds interest continuously, does the daily interest rate change if one year is longer than another?
- jkulubya 6y agoIn the kind of finance where you’re dealing with interest payments, you choose/agree on/accept a day count convention and run with it. https://www.investopedia.com/terms/d/daycount.asp https://www.investopedia.com/terms/d/daycount.asp