Please see the RPNCalc GitHub homepage for a much more detailed usage explanation, as well as submit bugs, provide enhancement suggestions, etc.
With a Reverse Polish Notation (RPN) calculator it is easy to do complex calculations, especially if there are parentheses involved. For example, to perform the following calculation:
x = SQRT((((5+3) * 8)/2) ^ 6)
RPN Steps: 5 enter 3 + 8 * 2 / 6 ^ SQRT
You start on the inside and work yourself out. It's based on a stack and really makes intuitive sense when you use one.
Over the years I've used various RPN calculators on my computer, but I failed to find a simple command line version that I liked. Therefore, I decided to write one. It was easy to write, easily extensible, and since it's in Java, should run wherever I need it to run.
If you have not heard of an RPN calculator, or for some reason just enjoying reading about various calculator notations, here is a link to the Wikipedia Article : https://en.wikipedia.org/wiki/Reverse_Polish_notation
To execute this snap, just run
rpncalc from the console.
High Level Usage
RPNCalc is a console application that will start at a prompt. Entering 'h [ENTER]' will display the in-program help page. This lists all of the commands and operands that can be used, but it is fairly terse.
On the command line you'll enter numbers and press enter. These will then be added to the stack. RPNCalc operates on a stack principle where last in is first out. You can then enter in an operand, such as + or /, to perform the action on the items at the end of the stack. So to add two numbers you can simply enter
[ENTER] which add the number 2 to the stack. Then
[ENTER] which will put it on top of the stack (which is line 1 at the bottom in the program). Then
[ENTER] to add them. The 2 and 3 come off the stack and 5 is added. As a shortcut, for the basic operands, you can skip a step by entering
[ENTER] and the end and it will perform the shortcut. I'm not going to into a lot of detail on how an RPN calculator works, that's Wikipedia's job, but it's fairly easy and better explained on the GitHub link above. Once I got the hang of it, I rarely use another style.
One note is that the stack always contains decimal numbers. You can enter in a simple fraction and it will convert it.
1 5/16 [ENTER] will add 1.3125 to the stack
14/8 [ENTER] will add 1.75 to the stack
frac [base] command will display a fractional equivalent of the top stack item.
There are too many details to describe here with Snapcraft's length limitations, so please see the developer's website listed above for a comprehensive set of details.