Repository navigation
README
Ilia Maslakov edited this page Oct 17, 2026
·
1 revision
A calculator of expressions in reverse Polish notation: the operands
come first, then the operator.
| Input | Output | Note |
|---|---|---|
2 3 + |
5 | sum |
10 4 - |
6 | difference |
6 7 * |
42 | the answer |
1 0 / |
0 | division by zero |
flowchart LR
A[line] --> B(tokenize)
B --> C{number?}
C -->|yes| D[push]
C -->|no| E[apply]
E --> D
The stack holds at most
if (stack_pop (s, &b) != 0 || stack_pop (s, &a) != 0)
return -1;meson setup buildmeson compile -C build./build/calc
An empty line quits.
bluerig on GitHub |
Issues |
F1 in the editor and man bluerig have the full reference.
The editor
Beside the text
Extending
About the wiki