MathRPN - Complete scientific RPN calculator
Version: 1.0MathRPN is really a sweet RPN calculator. Unlike others that limit your ability to interact with the rest of the stack, MathRPN lets you operate on any set of selected stack rows and use your operation of choice.
Operating System: Mac OS X
Number formatting preferences and stack autosave complement its functionality, as well as the versatile regular expression engine that allows you to evaluate mathematical expressions in any application, via its service, and use user-defined functions and constants directly with the stack.
MathRPN also offers visual aid.
Here are some key features of "MathRPN":
RPN (Reverse Polish Notation)
· Most people are more familiar with regular arithmetic notation they learned in elementary school: 2 + 3 = 5. Essentially, the way it works is you provide an operand, then an operator, and then another operand. In RPN, it looks like this: 2 3 +. In RPN, you provide the operands first, and then the operation. Some times you only need to apply one operand and one operation (5!), in which case RPN style and arithmetic style work the same. It can initially take some time to get use to, but many people in the fields of engineering and mathematics love this format as it allows a user to have a "stack"
· Unlike arithmetic calculators, ones with RPN have what's called a stack. A stack is simply a container for numbers added manually and the results of previous operations. There's no silly memory button like on arithmetic calculators, as a stack allows you to keep all your numbers in plain site. On a stack, the most recent number is near the bottom (although, this is usually referrer to the top of the stack). There is also an input field right below the stack. For convenience, if anything is entered in the input field, that will be considered the bottom of the stack. If the number 2 is on stack level 1 and number 3 is on stack level 0, then hitting the subtraction key will result in 2-3=-1. Now, the values 2 and 3 are removed from the stack, and only -1 remains on level 0.
Roll and Swap
· Unfortunately, the numbers you want to use may be too far down the stack, and you may want to bring them to the top. Most RPN calculators provide two functions to move around numbers: roll and swap. Roll takes three number at the top and rotates them. Swap simply takes the two numbers at the top and simply swaps them. But, that still doesn't help you get at values on stack levels 3 and on. MathRPN has a really nifty solution to that...
· There's a couple of really neat things you can do with numbers on different stack levels. First, you can select them. No biggie there, but MathRPN allows you to operate on all selected items (if a stack item is selected and there is input in the input field, then that is also considered selected)! So, if your stack contains 4,3,2,1,0 on levels 4,3,2,1,0 and you select 4,3,1 and hit the subtraction key, your stack will then look like 2,0,2. Why? The first 2 and 0 what where left on the stack. Because 3 and 1 are near the top of the stack (remember 0 is the top), 3-1=2 is calculated, and then 4-2=2 is calculated. FInally, the value is added to the top of the stack. Viola! It works slightly differently for operations that one require one input. If you select 4,3,1 like in the last example and hit the factorial key, your stack will then look like 24,6,2,1,0. Why? Unlike operations that require two inputs, single input operations can simply place the new value where the old value was on the stack, instead of placing them at the top,
· But wait, there's more! You can even drag and drop stack rows to get at them more easily. Simply selected the rows you want to move and drop them where you want to go (onto defaults to a drop below, above defaults to a drop above). Additionally, that works for multiple selections (although in this case, the input text field is not considered to be selected). And one more thing, you can double click on and row and change it's value, a nice feature that most RPN calculators either don't provide, or don't provide an easy way to do so.
· And one more thing. Remember the limited roll and swap? Well now, you can roll and swap any selected stack rows! One caveat is that swap only works on two rows, but you can select 50 rows and watch them roll around for hours of fun!
· This is still a work in progress, but if you go to MathRPN -> Preferences and select the Number panel, you'll see several options on how to change the way everything looks. One thing: scientific notation and switching commas and periods are incompatible and so both cannot be enabled at the same time. If you see any weirdness in how numbers are showing up, please tell me what number and with what preferences so that I can fix it as soon as possible.
· To save space, I created the INV and HYP keys. When toggled, they change the values of the operations in the bottom right hand box to their respective inverse and hyperbolic operation (if applicable).
· Math Expression Evaluation
· MathRPN provides a basic service (yep, install this app in your Applications folder, logout and back in and you'll see it in your Services menu) that allows you to select mathematical expressions and have them evaluated on the fly. It always works in radians (sorry), and I didn't personally write the code that performs the evaluation, so I would take its return values with a grain of salt. Additionally, under the Extras menu is located a menu item that will bring up a window for evaluating math expression in MathRPN.
· Graphing support is here... mostly. Although still beta-ish, you can graph pretty much anything of the form y = f(x). Tic marks and such are lacking, but zoom control is in, as well as the ability to graph up to ten functions with different colors at once. Additionally, you can use functions and constants you've defined in the user-defined constants and functions section to graph.