Skip to content

px86/bmee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.