New: How does the T register work? See the manual
This is a basic scientific RPN calculator. It's a powerful scientific calculator with many popular features.
This is an RPN calculator. If you don't know what that means, or are not a fan of RPN, stop now; this is not the calculator for you.
Version 3.1 Introduces user-control of display rounding for small numbers in FIX mode, and Portuguese translation.
Version 3.0 is a major release which switches the core math code from binary to decimal arithmatic. This eliminates certain kinds of round-off error, improves compatibility with classic HP calculators, and improves precision.
Version 2.31 introduces the dynamic ←/CLx key which changes its symbol depending on whether data entry is happening. Also added a "Rate This App" feature, accesible via the help menu.
Version 2.30 brings up the menu by tapping the display. A long press on the display brings up the copy/paste menu.
Version 2.23 adds the "tape" display (look for "Calculator Tape" on the menu, or tape somewhere on the keyboard.) which allows you to view or share a record of all your recent interactions.
Version 2.0 is now released. This is a complete re-write based on the RpnCalc Pro code base. This new version has a menu which allows you to switch between full scientific mode and basic mode (with easier to touch buttons).
Version 2.0 also features built-in help, and copy-and-paste of the X display.
Version 2.0 has improved appearance, especially on larger devices such as the Verizon Droid.
To access copy-and-paste, press and hold the X display just as you would on any Android text widget.
In general, enter numbers using digits,
.,
EEX, and
Use the f button for shifted functions.
The calculator uses a 16-level stack. The top four levels are labeled X,Y,Z,T and are shown on the display.
There are 10 memory registers, plus some registers used for statistics. The STO and RCL buttons can access the memory registers. The ∑ buttons write to the statistics registers.
News and updates available by following @RpnCalc on Twitter.
If you're already familiar with RPN, feel free to skip this section.
In a nutshell, Reverse Polish notation means that calculator functions are performed as soon as you command them. With RPN, you enter two numbers, press +, and the addition function is executed immediately. In contrast, an algebraic calculator remembers that you pressed + and executes it later, when you press =. If you were to enter "1 + 2 × 3 =" into an algebraic calculator, the addition would not occur until the very end.
Because of RPN's "do what I say" approach, the "=" key and parenthesis keys would be superfluous. RPN calculators do have an "ENTER" key, on the other hand, to seperate one numeric entry from another.
As a practical example, let's look at the "1 + 2 × 3" example from above. Instead of entering the expression as it's written, we calculate it the way we would actually solve the problem with pencil and paper. That is, first we would multiply 2 and 3, then we would add 1.
On an RPN calculator, the process would be to first enter the value 2 with the key sequence 2 ENTER. Next, we would multiply by 3 with the sequence 3 ×. Finally, we would add 1 with the sequence 1 +.
This may all seem a little confusing to someone who is used to the algebraic style of keyboard input, but after a little use, you will come to find RPN to be a more intuitive interface.
In short, RPN works the way your brain actually works, not how you write things down on paper.
A point to ponder: algebraic calculators actually use a mixture of algebraic notation and RPN. For two-number functions, like addition, an algebraic calculator uses algebraic notation, while for one-number functions like square-root or 1/x, you find yourself using RPN. For example, an algebraic calculator computes square roots by first having you enter the number, and then pressing the √ key.
How would you compute √(4²+3²) on an algebraic calculator? Damned if I know, and I bet you don't know either without looking it up. Maybe it's in the manual. Either way, I guarantee it's really a mixture of algebraic and RPN unless it's an unusually fancy calculator.
(With an RPN calculator, you do it just the way you would do it on paper: compute 4², compute 3², add them together, take the square root.)
The stack is a storage area within the calculator that holds values until they can be processed. Both algebraic and RPN calculators have stacks, but RPN calculators expose the stack to the user.
By default, the stack in RpnCalc and RpnCalc Pro holds sixteen numbers. The most recent four numbers are shown on the display and known as X, Y, Z, and T, with X being the most recent.
You can set the stack size to either 4 or 16 in Preferences. If you're a fan of the T register, you might prefer the smaller stack size.
Try it: Key in a number and then press the ENTER key. See that the number you entered as X has been copied to Y. When you enter another number, it becomes the new X value. Press ENTER again. Now you'll see that Y has been moved to Z and X has been copied to Y as before.
Key in yet another number and press ENTER again. Now, the old Z value has been moved to T, Y has been moved to Z, and X has been copied to Y.
The display might now look like:
T: 123.00 Z: 456.00 Y: 789.00 789.00
If you keep entering numbers in this way, the stack will fill up with data, with the most recent data always in the X display. This process is known as "pushing" the stack, since each new value pushes the previous values deeper into the stack.
You can review the contents of the stack by pressing the R↓ key. After you've pressed this key sixteen times, the stack will be back to where it was.
Two-number functions, such as + take the most recent two numbers (X and Y) from the stack, perform the operation on them, and place the results back onto the stack as X.
Because two values were replaced by one value, the stack is then "popped", with older values making their way back to the front of the stack.
Try it: we'll re-visit the "1 + 2 × 3" problem, but this time enter the numbers in the order they appear. Since adding 1 to 2x3 is the last thing to happen, the value 1 will sit in the stack until the end.
You enter | The display shows | Notes |
---|---|---|
C | T: 0.00 Z: 0.00 Y: 0.00 0.00 |
Clear the stack |
1 | T: 0.00 Z: 0.00 Y: 0.00 1 |
X = 1 |
ENTER | T: 0.00 Z: 0.00 Y: 1.00 1.00 |
X pushed to Y |
2 | T: 0.00 Z: 0.00 Y: 1.00 2 |
X = 2 |
ENTER | T: 0.00 Z: 1.00 Y: 2.00 2.00 |
Stack pushed again |
3 | T: 0.00 Z: 1.00 Y: 2.00 3 |
X = 3 |
× | T: 0.00 Z: 0.00 Y: 1.00 6.00 |
X receives 2×3; stack is popped. |
+ | T: 0.00 Z: 0.00 Y: 0.00 7.00 |
X receives 1+6; stack is popped. |
Let's evaluate:
3+7² ———— 8+5
On paper, you would first find the value 7², then for 3+7², then the value for 8+5, and then divide them. With RPN, we do the exact same thing.
You enter | The display shows | Notes |
---|---|---|
3 ENTER | T: 0.00 Z: 0.00 Y: 3.00 3.00 |
First value entered |
7 | T: 0.00 Z: 0.00 Y: 3.00 7 |
X = 7 |
f X² | T: 0.00 Z: 0.00 Y: 3.00 49.00 |
X receives 7² |
+ | T: 0.00 Z: 0.00 Y: 0.00 52.00 |
X and Y are added |
8 ENTER | T: 0.00 Z: 52.00 Y: 8.00 8.00 |
8 entered, previous value pushed into stack. |
5 + | T: 0.00 Z: 0.00 Y: 52.00 13.00 |
X receives 8+5 |
÷ | T: 0.00 Z: 0.00 Y: 0.00 4.00 |
And finally, we divide. |
Let's evaluate:
√(4²+3²)
On paper, you would first find 4², then 3², then add them together, and finally take the square root. With RPN, we do the exact same thing.
You enter | The display shows | Notes |
---|---|---|
4 f X² | T: 0.00 Z: 0.00 Y: 0.00 16.00 |
4² entered |
3 f X² | T: 0.00 Z: 0.00 Y: 16.00 9.00 |
3² entered |
+ | T: 0.00 Z: 0.00 Y: 0.00 25 |
Add |
√ | T: 0.00 Z: 0.00 Y: 0.00 5 |
Square root |
Note that we never even used the ENTER button. The ENTER button's main purpose is to seperate two numbers that are being entered one right after the other, but that wasn't needed here.
The last register in the stack is special. If your stack size is 4, that's the T register. If your stack size is 16 it's that 16th register, which you can't see on the display. You might want to set your stack size to 4 in Preferences when reading this section.
As I mentioned above, many operations "pop" the stack, causing older values to make their way to the top. For example, the + function adds X and Y and stores the sum in X. At this point the stack "pops" up one level, with the value in Z moving to Y and the value in T moving to Z. The value in T also stays where it is so now there are two copies.
Suppose your stack looks like this (type 1 ENTER 2 ENTER 3 ENTER 4):
T: 1.00 Z: 2.00 Y: 3.00 4
Now press the + button:
T: 1.00 Z: 1.00 Y: 2.00 7.00
You can see that Z(2.00) was copied to Y and T(1.00) was copied to Z and that T still has its old value of 1.00.
(Reminder, you'll need the stack size set to 4 in Preferences unless you feel like hitting ENTER 16 times to fill the whole stack.)
Why this is useful:
Sometimes you want to perform an operation repetitively. By putting a value into the T register, you effectively fill the entire stack with a single value and keep it filled.For example, suppose you were interested in powers of two. You might fill the stack with 2's by entering 2 ENTER ENTER ENTER
T: 2.00 Z: 2.00 Y: 2.00 2.00
Now just keep hitting the × button to your heart's content:
T: 2.00 Z: 2.00 Y: 2.00 4.00
× × × × ×
T: 2.00 Z: 2.00 Y: 2.00 128.00
A more intersting example: what's the value of a $1000 bank account over time if the annual interest rate is 5%?
First fill the stack with 1.05: 1.05
ENTER ENTER
ENTER
T: 1.05 Z: 1.05 Y: 1.05 1.05
And now the initial bank account value: 1000
T: 1.05 Z: 1.05 Y: 1.05 1,000
Now just keep hitting × for each year of interest:
T: 1.05 Z: 1.05 Y: 1.05 1,050.00
T: 1.05 Z: 1.05 Y: 1.05 1,102.50
T: 1.05 Z: 1.05 Y: 1.05 1,157.63
And so forth.
Shifted functions | |
---|---|
f | Used to access the shifted functions (displayed in orange.) You can also access the shifted functions with a long press on the key. |
Data Entry | |
0…9 . | Data entry |
CHS | Change sign.
For example, for -3 , enter
3 CHS. |
EEX | Exponent for scientific notation. For example, key 1 . 2 EEX 9 for 1.2×109 (1.2 billion.) |
Note: the CHS key can also change the sign of the exponent. For example: 1 . 2 EEX 9 CHS will enter 1.2×10-9 | |
ENTER | Enter current value, pushing it onto the stack and making the calculator ready for a new value. |
← | Clear last keystroke during data entry; clear X register otherwise. |
C | Clear stack |
AC | Clear everything |
REG | Clear registers |
Last X | Recall most recent X value |
X↔Y | Swap X,Y values |
R↓ | Rotate stack down |
π | Pi |
Math | |
+ | Add X and Y |
- | Subtract X from Y |
× | Multiply X and Y |
÷ | Divide X into Y |
MOD | Compute Y modulo X |
√x | Compute square root of X |
x² | Compute square of X |
ex | Compute e to X power |
10x | Compute 10 to X power |
ln | Compute natural log of X |
log | Compute log base 10 of X |
yx | Compute Y to power of X |
1/x | Compute 1/X |
SIN | Compute sine of X |
COS | Compute cosine of X |
TAN | Compute tangent of X |
ASIN | Compute arcsine of X |
ACOS | Compute arccosine of X |
ATAN | Compute arctangent of X |
INT | Return integer part of X |
FRAC | Return fraction part of X |
x! | Compute X factorial |
Display and Data Modes | |
SHOW | Show the current X value in full precision. |
BIN, OCT, DEC, HEX | Change base. See below for more information about hex mode. |
FIX, SCI, ENG | Set fixed-point, scientific, or engineering notation. Choose a
display mode and enter a single-digit precision, e.g.
FIX
2 See also Formatting Rule for more information on controlling display rounding for small numbers. |
DEG, RAD, GRD | Switch between degrees, radians, and gradians |
Memory Registers | |
STO r | Enter a digit in 0..9 to store
X to a memory register. Enter
. and a digit to store to registers 10-19. Example: STO . 5 will store X in register 15. |
RCL r | Recall specified register |
STO + r | Add X to a memory register Example: STO + 2 will add X to register 2. |
STO − r | Subtract X from a memory register |
STO × r | Multiply X to a memory register |
STO ÷ r | Divide X into a memory register |
RCL + r | Add a memory register to X Example: RCL + 2 will add register 2 to X. |
RCL − r | Subtract a memory register from X |
RCL × r | Multiply a memory register to X |
RCL ÷ r | Divide a memory register into X |
RCL ∑+ | Recall specified statistics registers. This may recall one or two values, depending on the registers you choose. |
Percents | |
% | Compute X% of Y [X = X*Y*.01] |
Δ% | Compute percent change from Y to X [X = 100*(X-Y)/Y] |
Conversions | |
→P | Rectangular to polar; convert X,Y to R,θ |
→R | Polar to rectangular; convert R,θ to X,Y |
→H | Hours.mmss to hours |
Example: How many hours is 2:20:33? Solution: Enter 2.2033
→HAnswer: 2.34 hours | |
→HMS | Hours to hours.mmss |
Example: What is 1.8 hours in hours, minutes,
seconds? Solution: Enter 1.8
→HMSAnswer: 1:48:00 Hint: Use SHOW to see all the digits. | |
→RAD | Degrees to radians |
→D | Radians to degrees |
Permutations | |
P(x,y) | Return number of permutations of X items from a population of Y |
Example: How many ways to draw three marbles
from a sack of 8? Solution: Enter 3 ENTER
8 P(x,y)Answer: 336 | |
C(x,y) | Return number of combinations of X items from a population of Y |
Example: Same as above, but the order doesn't
matter. Solution: Enter 3 ENTER
8 C(x,y)Answer: 56 |
The RPN calculator can perform various statistical calculations on X and Y values. (If you don't care about the Y values, just ignore them.)
The calculator uses a few memory registers for statistics calculations. These are:
R1 | n | the number of values that have been entered |
R2 | ∑X | the sum of all X values |
R3 | ∑X² | the sum of all X² values |
R4 | ∑Y | the sum of all Y values |
R5 | ∑Y² | the sum of all Y² values |
R6 | ∑XY | the sum of all X×Y values |
Statistics Functions | |
---|---|
c∑ | Clear statistics registers to zero |
∑+ | Add X,Y to statistics registers |
∑− | Subtract X,Y from statistics registers (this is the best way to 'undo' ∑+) |
x | Return mean X,Y values to X,Y registers |
σ | Return standard deviation of X,Y |
L.R. | Linear Regression; return slope and intercept |
y,r | Linear Estimation: Compute f(X); confidence value returned in Y |
x,r | Linear Estimation: Compute f-1(X); confidence value returned in Y |
RCL ∑+ | Recall specified statistics registers. This may recall one or two values, depending on the registers you choose. For example, RCL ∑+ 2 would recall the ∑X and ∑Y registers into X and Y. (You can also recall any of R1-R6 directly, but this feature saves you the trouble of remembering which memory register is which statistics value.) |
If your Android phone has a keyboard (such as the G1, Samsung Moment, or Motorola Droid), then keyboard keys can be used as shortcuts for certain buttons.
The digit keys, and decimal point keys on your keyboard correspond to the same buttons on the calculator. Likewise, the +, -, *, / keys represent the +, -, ×, and ÷ buttons. The E key represents EEX.
In hex mode, the A through F keys enter hex digits.
Keyboard shortcuts: | |
---|---|
F | f |
0…9 | 0 … 9 |
. | . |
E | EEX (exponent) |
C | CHS (change sign) |
+ - * / | + - × ÷ |
DEL | ← |
Enter | ENTER |
X | X↔Y |
R | RCL |
S | STO |
When in hexadecimal (or binary or octal) mode, the meaning of a few of the buttons and keys change. In particular, you will note that the top row of buttons have been relabeled with the letters 'A' through 'F'. While in hex mode, the math functions previously associated with those buttons will not be available.
Likewise, the 'A' through 'F' keys on the keyboard will enter the corresponding hex digits.
In particular, the 'F' key is no longer available as a shortcut to the f calculator button. This will probably cause you some confusion the first few times you try to use f DEC to return to decimal mode. However, you should quickly get used to using the f button on the screen instead.
Menu > Preferences brings up the user preferences dialog. Preferences include:
Q: How do you set the number of decimal places?
A: Use
f FIX,
f SCI, or
f ENG to set the display
format and number of decimal places.
Q: How do I turn keyclick on?
A: Through the menu. Go to Menu > Preferences.
Q: Why isn't TAN(pi/2) an error?
A: Good-old fashioned round-off. No calculator can store an exact
representation of pi. This means that TAN(pi/2) will be a very large
number, but not an error. A real HP calculator behaves the same way.
Q: The bottom row of buttons is partly obscured on Blackberry Playbook
A: That's the Android navigation bar. Dismiss it by touching the little icon at
the extreme lower-right of the screen.
While we're on the subject of Android on the Blackberry Playbook, here are a couple new gestures worth knowing: Swipe down from the top of the screen to get the RpnCalc menu. Swipe up from the bottom of the screen to minimize RpnCalc and navigate to other applications. Swipe diagonally up and to the left (or right) from the bottom of the screen to go "back" one level, just like pressing the "back" button on Android.
Q: I can't get this app to download.
A: Several people have reported this problem. It's a
known bug
in the Android Market and affects many, if not all apps. It's not specific to RpnCalc.
A: Many people who have trouble installing apps from the market have reported that if they log onto the Google "Talk" application, the problem goes away. It doesn't make any sense, but there you have it. Give this a try before reporting problems.
If you still have a problem, contact me with a detailed description of the symptoms.
Q: How do I switch from scientific mode to basic and back?
A: The device's menu lets you switch between the calculator's various
operating modes. It also lets you bring up the built-in help pages.
Q: Where is the Clx button?
A: Replaced by the
←
button, which is better. The
←
button deletes one character when you use it during data input, and acts
like the old Clx button the rest of the time.
Q: Where is the +/- button?
A: It's labeled
CHS, which stands for "Change Sign".
Q: Can you make it display commas between the digits?
A: It should be doing that already provided your system locale is
set properly, but there seems to be a bug on the
Motorola Droid device which we're looking into now. If you see this
on anything other than a Droid, please write to us.
Otherwise, you can go to Menu > Preferences and set the comma display any way you like.
RpnCalc privacy policy is really quite simple: RpnCalc does not collect any personal information of any kind. It never accesses the internet and it never sends any information whatsoever to anybody.
RpnCalc can be launched with the "org.openintents.action.CALCULATOR" intent. When the user exits the calculator, the final X value will be a double value in the extras "X" entry of the returned intent. The Y, and Z values will also be returned. See OpenIntents.org for full details.
This allows any application to launch a calculator for the user.
This software comes without any warranty, implied or otherwise.
Questions and comments can be directed to Ed Falk, efalk (at) users.sourceforge.net. When contacting me, remember that you didn't pay anything for the software.