A calculator with a support for functions (and fractions - thanks to Clojure).
Clojure and Leiningen have to be installed and configured.
Run tests:
lein test
Run the calculator:
lein run
Run as a standalone JAR:
lein uberjar
java -jar target/uberjar/calculator-_VERSION_-standalone.jar
When you run the calculator, you may type in an mathematical expression you want to evaluate, eg. ((8.0 - log(2, 16))^3! + 2*52) /100
, or a command.
help
,h
or?
: Show helpexit
,quit
orq
: Exit the calculator
+
-
(both subtraction and unary negation)*
/
^
(power)!
(factorial)
- nth root
sqrt(x)
cbrt(x)
- logarithms
log(base, x)
ln(x)
log10(x)
log2(x)
orlb(x)
- goniometric
sin(x)
cos(x)
tan(x)
ortg(x)
cot(x)
orcotg(x)
- rounding
round(x)
floor(x)
ceil(x)
- other
abs(x)
sgn(x)
(signum function)double(x)
pi
e
phi
orgolden_ratio
- parentheses:
(...)
or[...]
- separator (between function arguments):
,
or;