https://github.com/leucos/gorpn
Simple yet efficient Golang RPN terminal calculator
https://github.com/leucos/gorpn
go golang rpn rpn-calculator
Last synced: 2 months ago
JSON representation
Simple yet efficient Golang RPN terminal calculator
- Host: GitHub
- URL: https://github.com/leucos/gorpn
- Owner: leucos
- Created: 2018-10-18T21:28:01.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-10-04T14:27:54.000Z (over 3 years ago)
- Last Synced: 2025-01-26T11:44:00.413Z (4 months ago)
- Topics: go, golang, rpn, rpn-calculator
- Language: Go
- Size: 31.3 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Golang RPN calc
**DEPRECATED**
See https://github.com/leucos/grpn instead.
[](https://circleci.com/gh/leucos/gorpn/tree/master)
Simple yet efficient terminal RPN calcultator.
[](https://asciinema.org/a/207322)
## Installation
### Binary
Grab a [release](https://github.com/leucos/gorpn/releases).
### From sources
Using Go 1.11:
```
export GO111MODULES=on
git clone https://github.com/leucos/gorpn
cd gorpn
go install
```## Supported ops
- `+`, `-`, `*`, `/`, `%`
- `pow`, `^` (e.g. `2⏎3⏎pow⏎` yields `8`), `sqrt`
- `sin`, `cos`, `tan`, `asin`, `acos`, `atan`,
- `abs`, `ceil`, `floor`, `round`, `trunc` (e.g. `3.14159⏎2⏎trunc⏎`)
- `rad`, `deg` for angle modes
- `dup` (a.k.a empty input and ⏎) duplicates last stack item
- `swap` exchanges last 2 items in the stack
- `drop` removes last item in the stack
- `pi`, `phi` constants
- `precision`, `#` (e.g. `2⏎precision⏎` or ``2⏎#⏎`) limits number of displayed digits
- `cu1_cu2` returns exchange rate between `cu1` and `cu2` (e.g. `isk_eur` for xchange rate between ISK and EUR)
- `quit` or `` exists `gorpn`
- `/` key walks input history up or downMode is shown in the bottom line. If an error occurs, a red `E` will
show at the bottom right corner.## TODO
- [ ] undo
- [ ] non-intercative mode support (stdin / stdout)
- [ ] sentence recall (vs token recall) with PgUp/PgDown
- [ ] stack save on exit / load on start
- [ ] completion## Licence
DWTFYWPL
## Authors
@leucos
Inspired by https://medium.com/@jhh3/anonymous-functions-and-reflection-in-go-71274dd9e83a