This is a terminal app for math expressions calculation. It allows to make calculation fast right in your console, like:
calc "5.4 * 3,000.02 - 5*2 + 3! - (4+5) + sin 0 - cos PI"
See GNU GPLv3 LICENSE.txt
(tested on macOs 10.15.2 with openJDK 11)
Make sure you have jdk and xcode installed.
Run the following command in terminal ./gradlew :macosBinaries
After compilation you will find your executable in build/bin/macos/releaseExecutable
(tested on ubuntu 18.04 x64 with openJDK 11)
Make sure you have jdk installed.
Run the following command in terminal ./gradlew :linuxBinaries
After compilation you will find your executable in build/bin/linux/releaseExecutable
(tested on windows 10 x64 with openJDK 11)
Make sure you have jdk installed.
Run the following command in terminal .\gradlew.bat :windowsBinaries
After compilation you will find your executable in build\bin\windows\releaseExecutable
Make sure your executable is reachable in PATH. In case it is not you have 2 choices:
- You can move it to some of the directories from PATH (for example
/usr/local/bin/
) - You can add the folder where executable is located to your PATH
feel free to rename executable to make it more convenient for you
This app can process the following operators (ordered by priority):
(
,)
!
(factorial),^
(power),v
(square root)ln
(logarithm base e),log
(logarithm base 10),sin
,cos
,tg
/tan
*
/x
,/
-
,+
- PI
- e
In simple cases you don't need to put brackets. The app will try to parse an expression using the predefined priority of operators.
calc "5 + 6 * 2"
will be parsed like5+(6*2)
calc "5 (6 * 2)"
will be parsed like5*(6*2)
calc "sin cos 0"
will be parsed likesin(cos(0))
calc "5 + 4 * 2!"
will be parsed like5+(4*(2!))
If you not sure about priority fill free to use brackets:
calc "(5 + 6) * 2"
will be parsed like(5+6)*2
calc "((v3) * 2) / (5!)"