Shell calculator in C++ using boost::spirit
https://github.com/wo3kie/calc
C++11
boost
make
Operators
+, -,
*, /
^
==, !=, <, <=, >, >=
!, &&, ||
()
$./calc "1+2*3"
7
$./calc "2^3^2"
512
$./calc "1||(1/0)"
1
Functions
sin, con, tan
ln, log2, log10
rad, deg
abs
e, pi
$./calc "sin(rad(45))"
0.707107
$ ./calc "pi()*e()"
8.53973
Placeholders
_0 - number of arguments
_1, _2, ... _9 - placeholders
$./calc "_1+_2" 1 2
3
$ ./calc "(_0==3)&&(_1+_2+_3)" 5 10
0
./calc "(_0==3)&&(_1+_2+_3)" 5 10 15
30