rpncalc(1) a reverse polish notation (RPN) calculator.


rpncalc [-h]|[-v]|["expression"]


rpncalc partially emulates a HP 28S and is intended for every-day purposes (i.e. 1 1 +), not for complex calculations (use gnuplot(1) or octave(1) for these). rpncalc evaluates expression if given or reads from standard input otherwise. These features are not implemented:

 • complex numbers,

 • vector, matrices, lists and arrays,

 • algebraic input, symbolic evaluation,

 • units, and

 • variables.

rpncalc recognizes the following functions, operations, and constants:

! % %ch %t & * + -
/ ? ^ abs acos acosh alog and
arg asin asinh atan atan2 atanh bin cbrt
ceil char chs clear cos cosh dec depth
div drop drop2 dropn dup dup2 dupn erf
erfc exit exp expm fact floor fp gcd
help hex hypot inv ip j0 j1 jn
ld ldb lg lgamma ln lnp1 log max
min mod neg not oct or over pick
pop prec prod push quit rand rdz rint
rnd rot shl show shr sign sin sinh
sl slb sq sqr sqrt sr srb sum
swap tan tanh warranty xor y0 y1 yn
| ~

Delimiters are ,, ;, space, tab and newline.

A few things have been added with respect to a HP28: the prefixes 0x resp. 0 stand for hexadecimal resp. octal constants, as in C. The Bessel Functions and the error functions are new, in order to make better use of the math library.


-h, --help
stands for help
-v, --version
prints out the current version of rpncalc and exits.


The floating point exception handling relies on the math library and is site- and architecture dependent.

Accuracy and range of the calculations is at the mercy of the math library (and generally much worse than the original).


David Frey


HP 28S is a trademark of Hewlett Packard Instruments.


look into /usr/doc/rpncalc/copyright