(12C) Base Conversion
|
08-25-2018, 02:32 PM
Post: #1
|
|||
|
|||
(12C) Base Conversion
This program is a slightly shorter version of the 2nd solution that uses the function NPV:
Code: 01 - 44 13 STO PV Example: 201410 → 37368 10 STO PMT 8 STO FV 2014 R/S Formulas Used Net Present Value NPV = net present value of a discounted cash flow. CFj = cash flow at period j. \(NPV=CF_0+\frac{CF_1}{(1+i)^1}+\frac{CF_2}{(1+i)^2}+\cdots+\frac{CF_n}{(1+i)^n}\) Percentage \(\Delta\%=100\ \frac{x-y}{y}\) Explanation We can calculate the remainders by dividing the number continuously by the base we want to transform to (here stored in FV): Code: 2014 ÷ 8 = 251 → 6 = 2014 - 8 × 251 These remainders have to be multiplied by powers of the base we transform from (here stored in PMT): Code: 6 = 1 × 2014 - 8 × 1 × 251 And then when we add up all the terms we get: Code: 3736 = 2014 + 2 × (251 + 10 × 31 + 100 × 3) To calculate the polynomial we use NPV. For this to work we have to solve for \(i\) in: \(1+\frac{i}{100}=\frac{1}{b}\) where \(b\) is the base we transform from. Thus \(\begin{align*} i &= 100\ (\frac{1}{b}-1)\\ &= 100\ \frac{1-b}{b} \end{align*}\) That's why we can use the \(\Delta\%\) function to calculate \(i\): Code: 14 - 45 14 RCL PMT I was a bit surprised that ENTER is needed here: Code: 01 - 44 13 STO PV But it appears that STO PV disables the stack lift. From the manual: Quote:In addition, the stack does not lift when a number is entered if the last operation performed was storing a number into a financial register. |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(12C) Base Conversion - Thomas Klemm - 08-25-2018 02:32 PM
RE: (12C) Base Conversion - rprosperi - 08-25-2018, 05:28 PM
RE: (12C) Base Conversion - Albert Chan - 08-25-2018, 06:38 PM
RE: (12C) Base Conversion - Dieter - 08-25-2018, 08:38 PM
RE: (12C) Base Conversion - rprosperi - 08-25-2018, 09:02 PM
RE: (12C) Base Conversion - Albert Chan - 08-25-2018, 11:06 PM
RE: (12C) Base Conversion - Thomas Klemm - 08-25-2018, 08:30 PM
RE: (12C) Base Conversion - Thomas Klemm - 08-27-2018, 08:29 PM
|
User(s) browsing this thread: 1 Guest(s)