Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/furuame/Arithmetic-Interpreter
https://github.com/furuame/Arithmetic-Interpreter
interpreter
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/furuame/Arithmetic-Interpreter
- Owner: furuame
- License: mit
- Created: 2017-11-10T13:10:38.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-01T12:35:36.000Z (over 6 years ago)
- Last Synced: 2024-05-18T21:41:52.917Z (6 months ago)
- Topics: interpreter
- Language: C
- Size: 13.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- AwesomeInterpreter - Arithmetic-Interpreter
README
# Arithmetic Interpreter
This is a simple interpreter to calculate arithmetic expression referenced from [Ruslan's Blog](https://ruslanspivak.com).## Build
* ```$ make main```## Need to know
* This interpreter can execute mathematical expressions like '34+7-5+3' or '2 * 52 / 8', etc.
* The supported operations are addition (+), subtraction (-), multiplication (*), division (/), power (^)
* The operations are executed from left to right, i.e. the interpreter doesn't give priority to multiplications, etc.
* Support Precedence and Parentheses.## Limits
* Number in the interpreter is handled with integer, so error exists when expression has float-point operation.## Examples
```
cal>> 2 + 5 - 2 /5
1cal>> 2 - 53 * 2
-102cal>> 10+3-44*2
-62cal>> 2 ^ 5 - 1
31cal>> 2 + - - 1
3
```