Open source console-based RPN calculator

Discussion in 'Electronics Resources' started by someonesdad, Jul 18, 2009.

  1. someonesdad

    Thread Starter Senior Member

    Jul 7, 2009
    1,585
    141
    Hmmm, I feel a bit like I'm tooting my own horn by posting some of the things I've posted lately. But hopefully, they'll help someone save some time.

    If you like using an RPN calculator and don't mind working from a console window, you can download the hcpy calculator. It's written in the python programming language. You'll also need to download python if you don't have it, as well as the mpmath library (a python library that allows arbitrary precision calculations). They're both freely available (see the links on the hcpy website).

    I patterned the program after the HP-42s calculator. I spent a fair bit of time coming up with the number display algorithms so that the calculator would display numbers the way I like to see them in a variety of formats. The calculator handles integers, fixed-bit integers, rational numbers, real numbers, complex numbers, and dates/times. It is not a programmable calculator, as such a thing is easier to do in a python script.

    I also wanted it to be easily extendable, as there's no way to anticipate the things that one might want to do in the future. Thus, for example, it would be a few minutes of work to write a routine that took all the resistor values in the stack and calculated the equivalent parallel resistance (this calculation would take only two or three lines of python code). Adding the new command to the calculator is trivial.
     
  2. t_n_k

    AAC Fanatic!

    Mar 6, 2009
    5,448
    782
    Hi Someonesdad,

    Very generous of you to make your work available to others!

    I like RPN calculators - have just recently bought a new HP35S.
     
Loading...