- is a **math-oriented language** inspired by Hewlett-Packard **R**everse **P**olish **L**isp (**HP28S** user manual is provided as a reference), it includes at least **stack**, **store**, **branch**, **test**, **trig** and **logs** commands
- is implemented as a a **command-line calculator** for GNU/Linux
- brings powerfull calculation facilities on floating point numbers with __arbitrary precision__, provided by **GNU MP** and **GNU MPFR** libraries
- uses that so cool **reverse polish notation**
## Quick examples
### easy calculation with **stacked results**
```
rpn> 1 2 +
3
rpn> 2 sqrt
2> 3
1> 1.4142135623730950488
```
### **programs** and **variables**
```
rpn> <<rot*swap2/negdupsqrot-sqrt>> 'quadratic_solution' sto
rpn> 1 2 -3 quadratic_solution
2> -1
1> 2
rpn> vars
var 1: name 'quadratic_solution', type program, value <<rot*swap2/chsdupsqrot-sqrt>>
```
### **local variables**
```
rpn> <<-> x y <<xy+ln>> >> 'P' sto
rpn> 1 2 P
rpn> 1.0986122886681096914
```
### **arbitrary precision**
Precision can be really high, up to 0x7FFFFFFFFFFFFFFF bits with GNU MPFR
Following objects are managed: **floating numbers**, **symbols**, **strings**, **programs**, plus language **keywords** (commands and flow controls)
```
4> 'symbol'
3> "string"
2> 12.3456
1> <<-> n <<01nforii2*inv+next>> >>
rpn>
```
### Command line
**rpn** is a cli interface with an **interactive editor** with autocompletion provided by **linenoise-ng**, see https://github.com/arangodb/linenoise-ng
```
rpn>
Display all 128 possibilities? (y or n)
!= -> > acosh atan cosh drop e exit for ifte max not pos r->d rot sinh sqrt sto+ tan unti xor
% ->str >= alog atanh d->r drop2 edit exp h inv min num pow rcl round sinv start sto- tanh until xpon
%CH / ? alog2 chr dec dropn else exp10 help ln mod or prec repea same size std sto/ test vars
*< ^ and chs default dup end exp2 hex log neg over purge repeat sci sneg step str-> then version
+ <= abs asin clusr depth dup2 erase fact if log2 next pi q roll sign sq sto sub type whil
- == acos asinh cos do dupn eval fix ift mant nop pick quit rolld sin sqr sto* swap uname while
rpn>
```
## keywords
### general
|keyword|description|
|-|-|
|nop | no operation |
|help | (or h or ?) this help message
|quit | (or q or exit) quit software
|version | show rpn version
|uname | show rpn complete identification string
|type | show type of stack first entry
|default | set float representation and precision to default
### real
|keyword|description|
|-|-|
|+| addition
|-| substraction
|neg| negation
|*| multiplication
|/| division
|inv| inverse
|%| purcent
|%|CH inverse purcent
|^| (or pow) power
|sqrt| square root
|sq| (or sqr) square
|mod| modulo
|abs| absolute value
|dec| decimal representation
|hex| hexadecimal representation
|prec| get float precision in bits when first stack is not a number, set float precision in bits when first stack entry is a number. ex: ```256 prec```