RPN Calculator

RPN Calculator

This applet is an RPN calculator build to demonstate the DFP math library. It is modeled loosely on the Hewlett Packard HP-10 series calculator. If you are familiar with the HP-12C financial calculator, this should look somewhat familiar.

In addition to running as an applet, it can be launched via Java Web Start, or you can just download and run the JAR file directly.

There is also a Palm OS version available.

4 Level Stack

This calculator is equiped with a four level stack like the one used in the HP-12C. The stack is composed of 4 registers, named X, Y, Z, and T. Only the X register is displayed. When the user inputs a new number, this goes into the X register.

When the user begins entering a number into the X register, the stack is pushed up. That is, the previous contents of the X register moves into the Y register, the previous contents of Y moves into Z and so on. For example, the table below shows what happens when the user inputs the number 5:

RegisterInitial StateFinal State

When a binary operator key (+, -, *, /, yx) is pressed, the X and the Y register are combined to produce a result. This result is stored in the X register and the stack rolls down. The Y register now contains what was in Z and Z contains what was in T. T remains unchanged. For example, if the plus key were pressed the stack would change as shown below:

RegisterInitial StateFinal State

Unary operators, such as sin and cos, replace the value of the X register with the result of the operation. The other registers remain unchanged.

The Enter key copies X into Y and pushes the stack up so that the previous Y goes into Z and so on as illustrated below.

RegisterInitial StateFinal State

Key Summary

KeyFunctionInverseKeyboard Shortcut
exRaise e to the power xNatural log of x
10xRaise 10 to the power xCommon log of x
CHSChange Signn
PiThe constant PIp
EEXexponent for sci notatione
x2squaresquare root
RvRoll stack downr
x:ySwap x and y registersx
<--Back space, clear Xbackspace
EnterPush X on stackRetrieve last X value enter
DRGSelect angle moded
INVSelect inverse functioni

Storage Registers

This calculator has 20 storage registers that can be accessed through the STO and RCL keys. To store a number in register R0-R9 press STO followed by the number of the register. For example, to store the current X register in R5, press STO 5. To recall R5 press RCL 5.

To access registers R10-R19 press the decimal point just prior to a digit. For example, to store in register R16, press STO . 6 . To recall register R16 press RCL . 6.

Arithmetic operations can be performed on each of the storage registers by pressing an operator key just after STO. For example to add the current value of the X (display) register to register R5 press STO + 5. This can be done with addition, subtraction, multiplication and division.