alandipert / minirpn
- Source
- Commits
- Network (1)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Tree:
2c5571b
Alan Dipert (author)
Sat Nov 07 12:48:00 -0800 2009
commit 2c5571b0dc356547703400ab58fd39f1f2b0e410
tree 8f00831376fc9eac5247cdefdf77adf948e634af
parent 87eb2d25e2f5ab9f98f4a0f8f69cc9e480c16e38
tree 8f00831376fc9eac5247cdefdf77adf948e634af
parent 87eb2d25e2f5ab9f98f4a0f8f69cc9e480c16e38
minirpn /
README.markdown
rpn - 4 function CLI RPN calculator
This is a small calculator in C for RPN calculating at the command line. Expressions are read from STDIN. Compile with make and run ./rpn to enter the REPL.
Usage
output
Prints 10, the value at the top of the stack.10 .addition
Prints 12, the sum of 10 and 2.10 2 + .subtraction
Prints 50.100 50 - .division
Prints 3.12 4 / .multiplication
Prints 9.3 3 * .
Note that you can 'peek' the top of the stack anywhere in an expression, ie:
1 2 + . 4 * . 5 + . 3 - .
Prints:
3
12
17
14

