https://github.com/camel-cdr/culator
A simple infix notation floating-point cli calculator
https://github.com/camel-cdr/culator
calculator infix-notation recursive-descent-parser
Last synced: about 2 months ago
JSON representation
A simple infix notation floating-point cli calculator
- Host: GitHub
- URL: https://github.com/camel-cdr/culator
- Owner: camel-cdr
- License: mit
- Created: 2020-12-30T15:10:57.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-05T14:56:07.000Z (almost 4 years ago)
- Last Synced: 2025-01-21T04:08:42.589Z (3 months ago)
- Topics: calculator, infix-notation, recursive-descent-parser
- Language: C
- Homepage:
- Size: 20.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Culator
A simple infix notation floating-point cli calculator supporting:
* Simple operations: `+`, `-`, `*`, `/`, `**`/`^`
* Grouping with parentheses: `(`, `)`
* Math constants, e.g.: `pi`, `e`
* Math functions, e.g.: `sqrt`, `sin`, `atan2`, `trunc`## Examples
```
$ culator
(3 + 2) / 3
1.66666666666667
3 + 2 / 3
3.666666666666672**32
4294967296e
2.71828182845905
pi
3.14159265358979sin(2*pi)
-1.73436202602476e-34
atan2(1, 1) * 180 / pi
45e^(1/3 + 2)
10.3122585013258
``````
$ # Calculate the average line width of FILE
$ culator "`wc -c README.md | cut -d " " -f1` / `wc -l README.md | cut -d " " -f1`"
29.1190476190476
```## Install
```sh
sudo make clean install
```# Licensing
MIT or public domain, see [LICENSE](LICENSE).## References
* Per Vognsen's Bitwise tutorial series [[day 3](https://youtu.be/0woxSWjWsb8)]