calc is just another one calculator, command-line-based, enabling you to get the answer you want quickly. It supports the basic operations, which may cover most people’s needs
operation | description | operation | description |
---|---|---|---|
+ | addition | % | modulo |
- | subtraction | ! | factorial |
* | multiplication | ^ | exponent |
/ | division |
For scientific functions, there are trigonometric, logarithmic, etc. A handful of constants, such as pi and rand for random number.
It’s used like:
% ./calc '3.4' 'atan(1/0) - 3.14159265358979323846 * sqrt 3'
3.4;-3.870601766
It has a couple of command-line options:
-n for newline, it’d be like for the case above:
3.4
-3.870601766-d for using in degree instead of in radian.
There is also results registers, for example:
% ./calc 'pi*2, cos$1, sin($1/4 + pi*$2)'
6.283185307,1,-1
I’d not say it has some very special features, which I don’t hope it has, since it’s a “Simple command-line based calculator.” Just like a few others including my fork of e, e.bash, they all do the same simple job, calculating out a number, that you want to know.
Believe or not, I had even had brief times of using Python as calculator and the Google. The latter is too powerful, yet too weak, because it’s web and I only want a simple command-line interface.
calc was written by Vivek Kannan in C99, under the MIT License, born in June, 2015. As of writing, it only has less than 400 lines of code.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.