/bmee

Basic Mathematical Expression Evaluator

Primary LanguageC++MIT LicenseMIT

bmee - Basic Mathematical Expressions Evaluator

Reads mathematical expressions from stdin and prints the result to stdout. It can be used within shell-scripts for shells like bash, where floating point arithmetic is not possible. All numbers (integers, floats etc.) are converted to a 64 bit floating point number, so be mindful of precision issues.

Compilation

Assuming that you have gnumake installed and are in the project root.

make

Usage

echo "100*(8-12/2)" | ./bmee

Note

  • It is implemented using a recursive descent parser.