rca -- a rich/RPN scientific and programmer's calculator
Any arguments on the command line are used as initial calculator input.
Entering a number pushes it on the stack.
Operators replace either one or two stack values with their result.
Most whitespace is optional between numbers and operators.
Input can include locale currency and digit grouping symbols (e.g. $12,345)
Always prefix hex ("0x7f") or octal ("0o177"), even in hex or octal mode.
Infix expressions are entered using (...), as in: (sin(30)^2 + cos(30)^2)
Below, 'x' refers to top-of-stack, 'y' refers to the next value beneath.
rca's normal exit value reflects the logical value of the top of stack.
Numeric
(2 operands)
+, - Add and subtract x and y
*, or x Multiply x and y
/, mod Divide and modulo of y by x
^, or ** Raise y to the x'th power
%, +%, -% x% of y, and y +/- x% of y
%? what percent of y is x?
(1 operand)
chs, or negate Change sign of x (2's complement)
recip, sqrt Reciprocal and square root of x
sin, cos, tan
asin, acos, atan Trig functions
atan2 Arctan of y/x (2 operands)
exp Raise e to the x'th power
ln, log2, log10 Natural, base 2, and base 10 logarithms
abs, frac, int Absolute value, fractional and integer parts of x
Bitwise
(2 operands)
>>, << Shift y right/left by x bits (logical shift)
ror, rol Rotate y right/left by x bits
&, |, xor Bitwise AND, OR, and XOR of y and x
setb, clearb Set and clear bit x in y
(1 operand)
~ Bitwise NOT of x (1's complement)
bitc Count of '1' bits in x
Logical
(mostly 2 operands)
&&, || Logical AND and OR
==, !=, <, <=, >, >= Arithmetic comparisons
! Logical NOT of x
Unit conversions
(1 operand)
i2mm, mm2i inches / millimeters
ft2m, m2ft feet / meters
mi2km, km2mi miles / kilometers
f2c, c2f degrees F/C
oz2g, g2oz US ounces / grams
oz2ml, ml2oz US fluid ounces / milliliters
q2l, l2q US quarts / liters
d2r, r2d degrees / radians
dd2dms, dms2dd decimal degrees / deg.mm.sss
mpg2l100km mpg to l/100km and vice versa
Constants and storage
sto, rcl Save to or push from off-stack storage
pi, e Push constant pi or e
lastx, lasty, lx, ly Push previous value of x or y
_<name> Push variable
= Assign variable. RPN: "3 = _v" infix: "(_v = 3)"
variables, or vars Show the current list of variables
clearvariables Discard all variables
Variadic
(use whole stack, or to mark, if set)
mark Mark the stack, to limit variadics' range
sum, avg, stddev Total, mean, and standard deviation of entries
snapshot Saves copy of selected entries
restore Push a copy of the snapshot, set mark
clearsnapshot Discard snapshot
Stack manipulation
clear Clear stack
pop Pop (and discard) x
push, or dup Push (a duplicate of) x
exch, or swap Exchange x and y
Other
(, ;, ) Infix expression grouping
: Treat rest of line as RPN. (for infix mode)
nop Does nothing, but at end of line, suppresses output
Display
P Print whole stack according to mode
p Print x according to mode
f, c, m Print x as float, currency, max float (30 digits),
d, u, h, o, b decimal, unsigned, hex, octal, or binary
automatic, or auto Select general purpose floating display format
engineering, or eng Select engineering style floating display format
fixed Select fixed decimal floating display format
digits Set number of digits for floating formats
Modes
F, C Switch to floating or currency mode
D, H, O, B Switch to decimal, hex, octal, binary mode
width, or bits Set effective word size for integer modes
zerofill, or zf Toggle left-fill with zeros in H, O, and B modes
rightalign, or ra Toggle right alignment of numbers
degrees Toggle trig functions: degrees (1) or radians (0)
autoprint, or ap Toggle autoprinting on/off with 0/1
separators, or sep Toggle numeric separators on/off (0/1)
mode Display current mode parameters
infix Toggle running mainly in infix, or in RPN
Housekeeping
?, or help Show this list (using $PAGER, if set)
config Show current configuration settings
state Show calculator state
precedence List infix operator precedence
quit, q, or exit Leave the calculator
echo Toggle echoing input when stdin is file or pipe
errorexit Toggle exiting on errors and warnings
debug Toggle visibility of debug/testing commands
license Display the rca copyright and license.
version Show program version
# Comment. The rest of the line will be ignored.
version v43 Apr 9, 2026
Tip: Use "rca help q | less" to view this help