When I'm working on a project and I need a quick calcul I usualy use Python. The problem is that it require many step.
- I launch python
- If i need some math function like
log10
orexp
I need to import themath
module. - And then I can type my calcul and get the result.
This is to many step for a quick calcul this is why I created tval
for Terminal (Math Expression) Evaluation
.
To build tval
it's easy. There is 2 way of doing it.
./build.sh
It will juste generate the tval
executable.
sudo make install
It will install tval
in your /usr/local/bin
folder.
To use tval
it's easy !
tval [OPTIONS] "EXPRESSION"
There is several options you can have access :
-h
,--help
: Print the help message-p PRECISION
: Set the precision of the result (default : 12)-s
: Print the result in the scientific format
tval "2 +5/2"
4.500000000000
tval -p 0 "sin(pi)"
-0
tval -s -p 2 "2*pi + 230"
2.36e+02
pi
/pie
: 3.141592653589793238462643383279502884197e
: 2.7182818284590452353602874713526624977572gr
(golden ratio): 1.61803398874989484820458683436563811
log
,log10
,log2
exp
tanh
,sqrt
sin
,cos
,tan
,atan
- Expression like
tan(pi/2)
should returninf
and not the maximum value for along double
.
I love working on this project. If you have any suggestion about new fonctionnalities dont hesitate !