An overengineered (because it's fun) cross-platform CLI calculator app with a rich set of features.
It is handy if you need to do some quick calculations while hacking in the terminal - no need to open a calculator app of any kind.
The flow of the app is as follows:
- Go (version 1.22 or higher) if you want to build the app from the source code.
Download the latest release for your OS from GitHub.
- via Homebrew:
brew tap n0rdy/n0rdy
brew install calcliTo enable, add the following file /etc/apt/sources.list.d/fury.list:
deb [trusted=yes] https://apt.fury.io/n0rdy/ /
You can do this either manually or by running the following command:
echo "deb [trusted=yes] https://apt.fury.io/n0rdy/ /" > /etc/apt/sources.list.d/fury.listIf you experienced this error:
bash: /etc/apt/sources.list.d/fury.list: Permission denied
try to do the following:
sudo -i
# enter your password
echo "deb [trusted=yes] https://apt.fury.io/n0rdy/ /" > /etc/apt/sources.list.d/fury.list
# click Ctrl+D to exitsudo apt update && sudo apt install calcliTo enable, add the following file /etc/yum.repos.d/fury.repo:
[fury]
name=Gemfury n0rdy Private Repo
baseurl=https://yum.fury.io/n0rdy/
enabled=1
gpgcheck=0
sudo yum install calclicalcliThis will start the app in the interactive mode. Type your expression and press Enter to get the result.
Press Ctrl+C or Esc to exit the app.
Check the bottom of the screen for the help message with the list of available commands and hotkeys.
- basic arithmetic operations:
+,-,*,/,%,^,!, as well as parentheses - integer and floating-point numbers (
.as a decimal separator) - a set of predefined constants:
pi,e - math functions:
abs(x)- the absolute value ofxacos(x)- the arccosine ofxasin(x)- the arcsine ofxatan(x)- the arctangent ofxceil(x)- the smallest integer value greater than or equal toxcos(x)- the cosine ofxexp(x)- the value ofe^xexp2(x)- the value of2^xfloor(x)- the largest integer value less than or equal toxln(x)- the natural logarithm ofxlog(x, base)- the logarithm ofxto the specifiedbaselog2(x)- the base-2 logarithm ofxlog10(x)- the base-10 logarithm ofxmod(x, y)- the remainder of the division ofxbyynrt(x, degree)- the root ofxof the specifieddegreepercent(x, y)- the percentage ofxfromyround(x)- the value ofxrounded to the nearest integersin(x)- the sine ofxsqrt(x)- the square root ofxtan(x)- the tangent ofx
- the result of the previous calculation is stored in the variable
$prand can be used in further calculations - it is possible to persist the result of the calculation or a value in the variable and use it in further calculations
$var = 5 + 5 - calling
pmem()system function will print all the variables stored in memory - review the history of calculations by pressing the
UpandDownarrow keys, or switching to the history mode by typing:hand pressingEnter - in history mode, press
/to search for a specific expression in the history
Have fun! =)