RPN — User Commands
NAME
rpn − reverse polish notation visual desk calculator
SYNOPSIS
rpn
DESCRIPTION
Rpn is a stack-based desk calculator with a screen-oriented front end. This calculator is very similar, in many respects, to old Hewlett-Packard scientific calculators. The available commands are listed in a menu at the top of the screen. the first few elements of its computation stack are listed next. At the bottom of the screen is a data entry area. Rpn uses “reverse polish notation”, or stack-oriented commands. Thus the basic syntax is arg arg op For example: 47 358 +
This command pushes two values on the stack (47 and 358), then applies the operation (+) to those two values. Operands are popped from the stack and replaced by the result of the operation. Items can be pushed onto the stack one at a time, or more complicated expressions can be entered all on one line: For example: 47 179 2 ∗ + or: 47 179 ∗ 2 +
Note that the previous two examples are different and produce different answers.
ARITHMETIC OPERATIONS
+Addition
-Subtraction
∗Multiplication
/Division
modModulo
∗∗Exponentiation
+-Negation
1/xInverse
minMinimum of two arguments
maxMaximum of two arguments
absAbsolute value
maxuintGenerates the maximum unsigned integer
maxintGenerates the maximum signed integer
LOGICAL OPERATIONS
and (&)
or (|)
xor (^)
not (~)
shr (>>)Shift right
shl (<<)Shift left
STACK OPERATIONS
xySwap top two stack elements
copyPushes a copy of the top of stack
clrxClear x, the top of the stack
yClear y, the next to top of the stack
clrsClear the whole stack
clrm NClear register number N
sto NStore to register number N
sto+ NAdd to register number N
sto- NSubtract from register number N
rcl NRecall register number N to top of stack
disp DDisplay D places before decimal point. Rpn uses exponential notation if a number can’t be display in this field width.
octDisplay stack in octal
nooctRemove octal stack display
hexDisplay stack in hexadecimal
nohexRemove hexadecimal stack display
signed(unknown function)
unsigned(unknown function)
degDegree mode
radRadian mode
TRIG FUNCTIONS
sinSine
cosCosine
tanTangent
sinhHyperbolic sine
coshHyperbolic cosine
tanhHyperbolic tangent
asinArcsine
acosArccosine
atanArctangent
asnhArc-hyperbolic sine
acnhArc-hyperbolic cosine
atnhArc-hyperbolic tangent
piGenerate the constant pi
LOGARITHMIC FUNCTIONS
lnNatural log
logBase-10 log
lg2Base-2 log
expExponential
alogBase-10 exponential
alg2Base-2 exponential
STATISTICAL FUNCTIONS
s+Statistical accumulation. This accumulates statistical data on two variables, X and Y, into numbered registers. The functions var, sd and rms use this data. Given a series of n correlated X and Y pairs, enter each pair in the x and y registers, and execute s+. The data is accumulated as follows: sto 10 n sto 9 sum XY sto 8 sum Y∗∗2 sto 7 sum Y sto 6 sum X∗∗2 sto 5 sum X
s-This is the inverse of s+ and is used to remove incorrectly entered X-Y pairs.
varThe variance of X and Y is computed in registers x and y, and also in registers 3 and 4.
sdStandard deviation of X and Y is computed in registers x and y, and also in registers 3 and 4.
rmsRoot-mean squared of X and Y is computed in registers x and y, and also in registers 3 and 4.
MISCELLANEOUS FUNCTIONS
sqrtSquare root
gcdvGreatest common divisor
combCombinatorial ??
factFactorial
lrgnLagrange ??
trunTruncate
rounRound
randGenerate a random number
CONVERSION FUNCTIONS
d-rDegrees to radians
r-dRadians to degrees
r-pRectangular to polar (two dimensions)
p-rPolar to rectangular
r-sRectangular to spherical (three dimensions)
s-rSpherical to rectangular
KEYWORDS
calculator, stack, reverse polish notation
Sprite version 1.0 — June 06, 1989