https://github.com/oldpanda/suan
Mathematical expression calculation tool
https://github.com/oldpanda/suan
Last synced: 4 months ago
JSON representation
Mathematical expression calculation tool
- Host: GitHub
- URL: https://github.com/oldpanda/suan
- Owner: OldPanda
- License: gpl-3.0
- Created: 2022-02-13T04:09:25.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T01:58:09.000Z (over 3 years ago)
- Last Synced: 2025-03-25T13:21:31.135Z (about 1 year ago)
- Language: Go
- Homepage: https://old-panda.com/2022/02/12/write-a-cli-using-golang-cobra/
- Size: 50.8 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# suan
[](https://pkg.go.dev/github.com/OldPanda/suan)
[](https://goreportcard.com/report/github.com/OldPanda/suan)
Suan( 算 ) is a CLI tool to calculate given mathematical expression.
Currently it supports addition, substraction, multiplication, division, and
exponent operations including any of their combinations with parenthesis.
## Install
```
go install github.com/OldPanda/suan
```
## Usage
```
» suan -h
Suan( 算 ) is a CLI tool to calculate given mathematical expression.
Currently it supports addtion, substraction, multiplication, division, and
exponent operations and any of their combinations with parenthesis.
Usage:
suan [flags]
Flags:
-h, --help help for suan
-v, --version Version information
```
### Examples
```
» suan "1 + 1"
2.000000
» suan "(3 + 4) * 5 - 2 * (3 + 9)"
11.00000
» suan "3 / 4 + 3 * 2 - 8^2 * 2"
-121.250000
```