ARPCalc - Al's Reverse Polish Calculator

If you don't know what a reverse polish calculator is, this page probably won't interest you!

I spent a while looking for a decent computer / phone based reverse polish notation (RPN) calculator. There are a few RPN calculators out there, but I didn't find one I liked. Most of the mobile phone ones I found tried to emulate a physical calculators, so lots of the functions were crammed into each button and hence the display was cluttered and hard to read.

I've been using this calculator daily since early 2017 so I'm fairly confident it works well. I've now decided to release it on the website in case others are interested. Here are a couple of screenshots, one from the Windows version and one from the Android version:

Features of ARPCalc

  • Dedicated reverse polish calculator with a simple-to-use interface.
  • High precision calculations using arbitrary precision floating point arithmetic.
  • Cross platform - Android, Windows, Linux or just run it in your web browser.
  • Keyboard shortcuts for most common functions for speed of use.
  • Engineering format numbers (exponents with powers in multiples of 3).
  • Buttons to switch between different engineering prefixes (e.g. 10,400, 10.4×103, 0.0104×106 etc).
  • Beautiful formatting of numbers (e.g. 276.3×10-6 or 276.3 µ instead of 0.0002763 or 2.763e-4).
  • Instant conversion between different bases (hexadecimal, binary, octal, decimal).
  • Conversion between 175 different units and currencies.
  • Quick access to common conversions (as chosen by me!)
  • Quick entry of SI prefixes:
    • Press 2 7 SI p to enter 27×10-12
    • On other calculators this would be 2 7 EXP 1 2 ± - that method also works in ARPCalc.
    • Keyboard shortcuts make SI units very quick to enter (2 7 Shift-S p).
  • 100 memory locations for storing intermediate values.
  • Support for binary exponents for maths on bytes (e.g. represent 15,728,640 as 15.0×220 or 15.0 Mi).
  • Display of the stack (this is currently only scrollable in the android version).
  • Choice of whether to use an "infinite" stack or a four element replicating one (as used on some of the HP calculators).
  • Copy / paste values to/from other applications. The Windows and Linux versions allow copying in a few different formats (either "pretty" text or as values that will be understood by other applications) - right click on the "X" value to see the options. The Android version only supports copying the value - long press on the "X" value to copy. It doesn't support paste. Copying / pasting isn't currently supported in the web browser version.

Screenshots

Here are a few screenshots from the Windows version of the application to give you an idea of what it looks like and how it works.

The left-hand image above (click for bigger!) shows the main number pad, along with the way that numbers are shown (by default) using engineering notation (with exponents in multiples of 3). The second image shows the function keypad with various functions for scientific and engineering computation.

The left-hand of these two images shows what the calculator looks like in hexadecimal mode. The top-right panel shows the X value in all four bases for quick comparison. The right-hand image shows the view that appears when you press STO (store) or RCL (recall): there are lots of locations to store values in for later use. Values are saved between sessions.

The left-hand of these two images shows the unit conversion keypad. The conversions are in pairs so the one that has been hovered over (and hence shows help information) converts to degrees Celsius from degrees Fahrenheit. The one to the immediate right of the button converts the other way (although I can't understand why anyone would want to convert to degrees Fahrenheit!).

The right-hand image shows the window that appears when you click "More" on the conversions screen (or press Ctrl-M). The conversions are in categories and each category (and unit) has a shortcut key so if there's a conversion you do often, you can learn the key sequence. For example, to convert from cubic centimetres to litres, you press Ctrl-M, R, A, J.

These two screenshots show the configuration options available in the application. If you hover over any option, there's a brief description of what it does.

Why Reverse Polish?

Reverse polish calculators typically use fewer keystrokes to perform a given calculation (and they never need parentheses). They take a bit of getting used to after a "normal" (immediate execution or infix) calculator, but once you've got over the initial hurdle, you won't want to go back.

Some simple examples of calculations using reverse polish notation other methods:

  • Task: calculate the sum (8 + 10) × 7 × (4 + 2)

    • Immediate execution: ( 8 + 1 0 ) × 7 × ( 4 + 2 ) = - 15 key presses
    • Infix: exactly the same as immediate execution - 15 key presses
    • RPN: 8 ENTER 1 0 + 7 × 4 ENTER 2 + × - 12 key presses
  • Task: calculate the sum 7 × (4 + 3) × 10 sin(30)

    • Immediate execution: 7 × ( 4 + 3 ) × 1 0 × ( 3 0 sin ) = - 17 key presses
    • Infix: 7 × ( 4 + 3 ) × 1 0 × sin 3 0 = - 15 key presses
    • RPN: 7 ENTER 4 ENTER 3 + × 1 0 × 3 0 sin × - 13 key presses

RPN also comes into its own if you need to add up a column of numbers and quantities but write down all the intermediate values. Type the first value, press ENTER, then type the quantity and press ×. The first intermediate value is displayed. Type the second value, press ENTER, then type the quantity and press ×. The second intermediate value is displayed. Press +. Type the third value, press ENTER, then type the third quantity and press ×. The third intermediate value is displayed. Keep pressing + and then entering each row and at the end (after the last +) the total is displayed. Now of course these days you'd probably just use a spreadsheet for something like this, but the RPN calculator is still a good and fast alternative.

Terms of Use

This software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and non-infringement. In no event shall the author and copyright holder be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.

Or to put it another way, this software is free but if it doesn't work or it causes your computer to break or your hamster to die, I'm not accepting responsibility. Use at your own risk.

Links

The web version runs completely in your web browser and is a good place to play around with the calculator and see if you like it.

The windows version is available as a compiled executable. There's no installer, just unzip it somewhere and run the executable. I use autohotkey to create a shortcut key that starts ARPCalc or brings it to the front if it's already running. Get in touch if you'd like a copy of the autohotkey script. It's important to note that this executable isn't signed so you may get warnings from Windows when you first run. For a hobbyist offering free software, the cost of getting an approved signing key is too much for me to justify.

The linux version has much less testing than the Windows version, but I've offered it in case it's of interest to others. It was compiled on Ubuntu 22.04, so requires a recent glibc. I've packaged it up as an AppDir, but I don't have much experience of linux desktop environments, so I probably won't be able to help much if it doesn't work!

The android version is currently only available as a downloadable APK. This can be installed directly onto your Android phone but will probably generate various warnings and you may have to enable the development options to allow it to be installed. I'll get it on the play store at some point. Get in touch if this is important to you.

Source Code

The Windows, Linux & Web versions of this application are open source, with the source code released under the GNU Public Licence. The source code and the details of the licence are available here.

I intend to release the source code for the Android version as well, but the repository is currently a mess with various other bits of unrelated experimental code stored in the same place and I need to find time to sort it out before releasing it.

Other Operating Systems

The software is written in a cross-platform manner so in theory should run on other operating systems. As well as those listed above, I also have a JVM version that will run on any desktop operating system, but it was written for older versions of java and it proved difficult to get it to run on different java versions so I have largely abandoned it. The source code that is used to create the Windows & Linux versions uses the Qt library and so should also work on Mac OS X. However, I don't have an Apple Mac and (as far as I'm aware) there's no way to compile software for Apple's operating systems without actually owning Apple's computers and operating systems. As I don't currently own any Apple products, I can't release a Mac OS X version. The same issue applies to an iPhone version, although as I understand it that would also require a substantial re-write of the code and I'm not going to do that. Therefore, if you want to use it on anything made by Apple, you're stuck with the web version, sorry!

Known Issues

  • Not all keyboard shortcuts will work on all keyboards / versions. The Qt library represents shifted keys in a different way to the web browser. While I've tried to accommodate all variants, I'm sure some things won't work. An example is Shift-2, which I chose as the keyboard shortcut for raising 2X. Qt represents this on my keyboard as Shift-" (even though it's technically just " as the Shift is what switches it from being 2 to "). On keyboards where Shift-2 doesn't produce ", that shortcut may not work. Similar issues apply to Shift-3 (convert US Dollars to GB Pounds) and Shift-4 (convert GB Pounds to US Dollars), among others.
  • Web version doesn't support copy/paste.
  • Windows, Linux & Web versions don't allow scrolling of the stack display.
  • There's no way to customise the selection of conversions that appear on the main screen (before you click "MORE"). There's no fundamental reason why this wouldn't be possible, but it would be a huge amount of work and I'm not going to do it!
  • On one version of ARPCalc, Windows Defender decided it was a virus or some other type of malware and deleted it. I'm hoping this doesn't happen again, but without a signing key I'm not sure I can protect against it. All I can do is promise that there's no malware included!
  • There's no easy way to check you've got the latest version. If you hover the mouse over the top left of the window, you'll see the date it was compiled; if you hover over the top-right you'll see the (somewhat cryptic) version control system changeset ID for the version you've got. However, there's no way to see whether what you've got is up to date.

If you spot any other issues, please do get in touch.


This website is free, but costs me money to run. If you'd like to support this site, please consider making a small donation or sending me a message to let me know what you liked or found useful.