Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

README.md

Copyright (C) 2015 Łukasz Czerwiński

Calc

Shell calculator in C++ using boost::spirit

Website

https://github.com/wo3kie/calc

Requirements

C++11
boost

How to build it?

make

How to run it?

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

About

Shell calculator in C++ using boost::spirit

Resources

License

Releases

No releases published

Packages

No packages published