Terminal RPN Calculator

App-icon

Screenshots

rpn calc v1.9 running in xfce4-terminal
rpn calc v1.9 with custom colorscheme in xterm

Preface and history ๐Ÿ“œ

First of all: This calculator is not another exactly emulated Hewlett Packard โ„ข calculator nor is it using ROM files to provide the full functionality. At the current state, it is not able to store and execute RPL-programs. Even so, if you are used to those calculators, you might remember and recognize the most useful commands. Lets say, the calculator mimics its great predecessors. In addition to the usual abbreviated commands, these can also be written as full words. Note that some commands are not implemented in the famous calculators but I found them to be useful anyway.

I am using RPN calculators since I was a teenager and still appreciate it. Hence, it is my intention to program a calculator which supports RPN (reverse polish notation) on the one hand and is executable in a terminal on the other hand. It is written in pure python and designed to be a simple and distraction free terminal shell tool with no dependencies. Despite the simple design, it has become a quite powerful calculator with a lot of functions. (Actually, this calculator has come a long way: I originally planned to create a pure Bash implementation using bc in the background, but ultimately decided against it during the implementation process. The current Python implementation is much more powerful and easier to maintain than the original Bash version would have been.)

Again, keep in mind: This is not the real and famous HP42Sโ„ข or HP48SXโ„ข that is supporting programming, unit conversions, graphs, equation solvers, libraries and lots of things I do not even know of. Those real calculators are an industrial and technical work of art I admire and may never be compared with.

Installation ๐Ÿ“ฆ

Linux installation ๐Ÿง

Windows installation ๐ŸชŸ๏ธ

Usage ๐Ÿ’ก

Disclaimer โš ๏ธ

Donโ€™t use this calculator if you plan to fly to the moon. Iโ€™m not kidding โ€” expect that some results might be wrong. Testing all functions and edge cases is a huge task.

General Usage ๐Ÿ‘‡

User Interface ๐Ÿ–ฅ๏ธ

The colors in RPN calc are taken from the default colors of the terminal shell itself. No other distracting fancy colors.

CTRL-N for help, CTRL-X to exit
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Terminal RPN Calculator vX.x.x               โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 4:                                           โ”‚
โ”‚ 3:                                         64โ”‚
โ”‚ 2:                                        100โ”‚
โ”‚ 1:                                      45054โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
input > โ–’

Example Text User interface above with some numbers entered in the visible stack and cursor after input.

Hotkeys โŒจ๏ธ

Hint (โ„น): If a hotkey is not working, this is most likely due to the terminal shell in use and itโ€™s predefined hotkeys. Workaround: enter the according command at the input prompt and hit ENTER.

Commands โšก

Info about commands ๐Ÿ“๏ธ

commands are executed by typing in and hit ENTER. This might feel rather like a shell therefore.

General commands ๐Ÿ“ข๏ธ

Stack commands ๐Ÿ“‘

Basic Arithmetic Operations ๐Ÿงฎ

As with the real rpn calculators, hitting the operators does execute an immediate operation. You do NOT have to hit the ENTER-key to do so.

Math functions ฦ’(๐‘ฅ)

The following functions can be used followed by hitting ENTER:

Constants โ—†

The following constants are implemented for now and can be entered followed by hitting ENTER:

Memory commands ๐Ÿง 

Modes ๐Ÿ”ง

Display Modes ๐Ÿ‘๏ธ

Base Modes โš™๏ธ

Notation of dec, hex or bin value(s) โœ’๏ธ

The notation of a hexadecimal or binary number can be typed in as follows:

Further notice ๐Ÿ’ฌ:

Conversion Modes ๐Ÿช„

angle conversions
temperature conversions

Note that values below absolute zero (-273.15ยฐC, -459.67ยฐF or 0 K) are returned as error.

time conversions
length conversions
english conversions
metric conversions
japanese conversions

Limitations โ–ฒ โ–ผ

Iโ€™m developing this pocket calculator in my spare time, so youโ€™ll notice that many features and functions โ€” such as the following โ€” are missing:

For the moment, I do not have intentions to implement these features. There might be other apropriate tools to use.

To Doโ€™s and Niceties ๐Ÿšง

The following features are on my to do list:

Error reporting ๐Ÿ›

Errors and bugs are possibly included. Error reports or corrections are welcome: โœ‰๏ธ sery@solnet.ch

Special Thanks ๐Ÿค

see also

bc(1), dc(1)