Crates.io | termcalc |
lib.rs | termcalc |
version | 1.0.0 |
source | src |
created_at | 2024-09-01 07:46:58.212519 |
updated_at | 2024-09-01 07:46:58.212519 |
description | a simple Terminal Calculator. |
homepage | https://github.com/rtbo/termcalc |
repository | https://github.com/rtbo/termcalc |
max_upload_size | |
id | 1359391 |
size | 161,310 |
A simple command line calculator.
The binary name is tc
.
If you are already in a terminal session and need a quick calculation,
typing tc "2.5 + 3.73 / 4"
is actually faster than grabbing
your desktop calculator or starting and using a calculator app.
tc
is also a lot simpler to use than bc
or dc
.
The manual states quite everything you need to know about tc
.
(and it'll take you about one minute to read)
$ tc "1.2 + 3^2 + sqrt(12)"
1.2 + 3^2 + sqrt(12) = 13.664101615137753
$ tc "cos(pi/3)" "sin(pi/6)"
cos(pi/3) = 0.5000000000000001
sin(pi/6) = 0.49999999999999994
$ tc -s "12*3 + 18*2.5 - 3 * 2.3" # or --strip
74.1
$ tc "1.4 + son(pi/6)" # typo
1.4 + son(pi/6)
^^^^^^^^^
error: Function `son` is unknown
See Grammar.ebnf