Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leo-210/polish-calculator
A reverse polish notation calculator made with gleam !
https://github.com/leo-210/polish-calculator
Last synced: about 2 months ago
JSON representation
A reverse polish notation calculator made with gleam !
- Host: GitHub
- URL: https://github.com/leo-210/polish-calculator
- Owner: leo-210
- License: cc0-1.0
- Created: 2024-08-09T12:46:15.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-09T13:06:12.000Z (5 months ago)
- Last Synced: 2024-10-15T06:10:02.737Z (3 months ago)
- Language: Gleam
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Reverse polish notation calculator
A [reverse polish notation](https://en.wikipedia.org/wiki/Reverse_Polish_notation)
calculator made with gleam !The program pushes the last result to the stack, so you can easily use it, while
still enabling you to do different calculations. For example :
```
> 3 4 +
7
> 3 +
10
> 3 4 +
7
```
The second input line is actually equivalent to `7 3 +`. The third one is equivalent
to `10 3 4 +`, and in these cases the program will ignore the first number instead
of returning an error.The 4 principal operation are supported (i.e. addition, substraction, multiplication
and division), and only positive integers are valid (the program can return negative
integer though). All other characters are treated as whitespace.So this is valid syntax :
```
> h3ll0 w0rld++
3
```## Running the program
You have to [install gleam](https://gleam.run/getting-started/installing/),
clone the project, then run :
```
gleam run
```