# HP Forums

You're currently viewing a stripped down version of our content. View the full version with proper formatting.
HP Prime Free programming. In thread Rectangular Coordinate Conversion, by using the Define key, I added functions R_to_P and P_to_R to HP Prime devices including the HP Prime Free - Lite. These two functions allow the CAS view to display exact values for the conversions. I recently used the Define key to add the function arsm, (N/2)*(F+L), to the HP Prime Free. For all the other HP Prime devices, I wrote a library of arithmetic series functions to find the nth term and sum of an arithmetic series. Besides Define the other programming option for the HP Prime Free is to use CAS variables. I used notepad++ with prime plug-in to first type the CAS variable. You could use any text editor. Then I use system copy and paste to enter it into the Windows HP Prime Free app.

Since the HP Prime Fee has no Finance Application library, program editor, or HP connectivity kit I used CAS variables to add the sint, cpint, loan, and ira CAS variables to give us basic finance operations.

Edit 10/19/2017 - added Begin return End to the functions - HP Connectivity Kit needed - Pro/virtual: crashed when Kit tried to display CAS Vars - Free version: using Begin return End with it's functions as well

Copy each of these functions to the CAS command line and press enter:

sint(a,p,r,t):=
BEGIN
return solve(a=p*(1+r*t),x);
END;

cpint(fv,pv,r,m,t):=
BEGIN
return solve(fv=pv*(1+r/m)^(m*t),x);
END;

loan(pv,pmt,r,m,t):=
BEGIN
return solve(pv=pmt*((1-(1+r/m)^(-m*t))/(r/m)),x);
END;

ira(fv,pmt,r,m,t):=
BEGIN
return solve(fv=pmt*(((1+r/m)^(m*t)-1)/(r/m)),x);
END;

Note: The Finance Application Library uses n in months where I use years, r in i% where I use decimals, and I use m for daily, months, quarterly, semi-annually, and annually. For additional CAS variables see my Post 3 and 5 in this thread's. Post 3 uses pivmat to solve dual simplex problem and Post 5 is where we add CAS variables to do a function's partial derivative.
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :