https://github.com/mivinci/calc
🧮 A minimal implementation for an integer calculator in pure C.
https://github.com/mivinci/calc
pure-c reverse-polish reverse-polish-calculator reverse-polish-notation
Last synced: about 1 year ago
JSON representation
🧮 A minimal implementation for an integer calculator in pure C.
- Host: GitHub
- URL: https://github.com/mivinci/calc
- Owner: mivinci
- Created: 2020-12-28T02:00:14.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-28T03:31:06.000Z (over 5 years ago)
- Last Synced: 2025-02-13T14:40:39.974Z (over 1 year ago)
- Topics: pure-c, reverse-polish, reverse-polish-calculator, reverse-polish-notation
- Language: C
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Calculator
🧮 A minimal implementation for an integer calculator in pure C. It uses reverse polish expression to do the calculating as follows: `1*(2+3) => 1 2 3+* => 5`
## Install:
```bash
git clone git@github.com:Mivinci/calculator.git
cd calculator
make
make install
```
## Usage:
To calculate 1*(2+3), just run:
```
calc 1*(2+3)
```
Or you might want to view the reverse polish expression:
```
calc 1*(2+3) -c
```
Or just run `calc` to enter input mode:
```
calc
>> 1*(2+3)
5
```
## Todos
- [ ] Support both float numbers and negative numbers.
- [ ] Extract from file.
- [ ] Should I use a tokenizer and a parser?