4 ms·
I wonder how the NPV algo is done. Prima facia, the way Id tackle it if I have a few extra registers is 1. Id write the exponent as n = R*m, where R is an int
by lrkrsBlurkn 2y ago
I wonder how the NPV algo is done.
Prima facia, the way Id tackle it if I have a few extra registers is
1. Id write the exponent as n = R*m, where R is an integer. R = 2 is probably best.
2. Then Id do pascal's triangle (every element is a simple combination comb[x,y]) for the expansion of the exponent (if R = 2 binomial expansion) and add in ascending order.
3. Then raise the answer to the power of m.
Of course, I can iteratively do steps 1-2 if the interest rate is very small.
- astroturf 2y agoHere's an HP article on the HP-80, a predecessor to the 12C. They describe an algorithm solving for interest rate: https://www.worldradiohistory.com/Archive-Company-Publications/HP-Journal/70s/HPJ-1973-05.pdf https://www.worldradiohistory.com/Archive-Company-Publicatio...