No description
.gitignore | ||
main.c++ | ||
Makefile | ||
readme.md | ||
release.nix | ||
stack.c++ | ||
stack.h++ |
_ __ _
_ __ ___ ___| |_ / _(_)_ __
| '_ \ / _ \/ __| __| |_| \ \/ /
| |_) | (_) \__ \ |_| _| |> <
| .__/ \___/|___/\__|_| |_/_/\_\
|_|
Postfix calculator implemented by Jakob Klepp.
Build
To build postfix just run make
.
Usage
The postfix calculator can be started with ./postfix
or make run
if you want to run postfix with drmemory.
To add a number to the stack, just type it in and press enter.
To perform a calculation, type in the operator
(+
, -
, +
, /
, %
)
and press enter. These operators will consume the top
two numbers of the stack and put the result back on top.
To display the result, type in =
and press enter.
This will consume the top number of the stack and display it.
If an operation would try to consume a number but the stack is empty the program will be terminated with a segmentation fault (it's a feature).