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 grouping symbols: $12,345.67
Always prefix hex (0x7f) or octal (0o177) input, 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.
Numerical operators with two operands:
+, - Add and subtract x and y
*, or x Multiply x and y
/, % Divide and modulo of y by x
^, or ** Raise y to the x'th power
>>, << Right/left logical shift of y by x bits
&, |, xor Bitwise AND, OR, and XOR of y and x
setb, clearb Set and clear bit x in y
= Assignment to variable
Numerical operators with one operand:
~ Bitwise NOT of x (1's complement)
chs, or negate Change sign of x (2's complement)
nop Does nothing
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
(, ) Infix grouping
; Infix separator (in RPN, discards y)
Logical operators (mostly two operands):
&&, || Logical AND and OR
==, !=, <, <=, >, >= Arithmetic comparisons
! Logical NOT of x
Stack manipulation:
clear Clear stack
pop Pop (and discard) x
push, or dup Push (a duplicate of) x
lastx, or lx Fetch previous value of x
exch, or swap Exchange x and y
mark Mark stack for later summing
sum Sum stack to "mark", or entire stack if no mark
avg Average stack to "mark", or entire stack if no mark
Constants and storage (no operands):
sto, rcl Save/fetch off-stack storage
pi Push constant pi
e Push constant e
_<name> Read or set a variable
Unit conversions (one 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
mpg2l100km mpg to l/100km and vice versa
Display:
P Print whole stack according to mode
p Print x according to mode
f, d, u Print x as float, decimal, unsigned decimal,
h, o, b hex, octal, or binary
state Show calculator state
Modes:
F, D, U Switch to floating point, decimal, unsigned decimal,
H, O, B hex, octal, or binary modes
precision, or k Float format: number of significant digits (%g)
decimals, or K Float format: digits after decimal (%f)
width, or w Set effective word size for integer modes
zerofill, or z Toggle left-filling with zeros in H, O, and B modes
rightalign, or right Toggle right alignment of numbers
degrees Toggle trig functions: degrees (1) or radians (0)
autoprint, or a Toggle autoprinting on/off with 0/1
separators, or s Toggle numeric separators (i.e., commas) on/off (0/1)
mode Display current mode parameters
Debug support:
r Print x as raw floating hex
R Switch to raw floating hex mode
rounding Toggle snapping and rounding of floats
tracing Set tracing level
Housekeeping:
?, or help Show this list (using $PAGER, if set)
precedence List infix operator precedence
vars, or variables Show the current list of variables
quit, q, or exit Leave the calculator
errorexit Toggle exiting on error and warning
license Display the rca copyright and license.
# Comment. The rest of the line will be ignored.
version v15 built Feb 3 2026 17:20:26
Tip: Use "rca help q | less" to view this help