https://github.com/furesoft/grain-expression-evaluator
https://github.com/furesoft/grain-expression-evaluator
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/furesoft/grain-expression-evaluator
- Owner: furesoft
- Created: 2024-03-29T06:33:18.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-14T13:57:31.000Z (about 2 years ago)
- Last Synced: 2025-08-11T18:27:36.268Z (10 months ago)
- Language: Batchfile
- Size: 675 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Grain Expression Evaluator
An engine to evaluate mathematical expressions written in Grain
## Usage
```grain
Scope.setVariable("n", 5, Evaluator.rootScope)
let result = Evaluator.eval("power(2,6) + pi - n")
print(result)
```
## Defining functions
```grain
Evaluator.eval("f(n) = (n * (n - 1)) / 2")
```