This is a simple method for creating a calculator using the built-in function support in the Bash shell.
and then the math equation you want solved.
Since this is using the bc command, its pretty powerful.
Close out the Terminal, re-open it, and you should have the function available.