Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 738 Bytes

README.md

File metadata and controls

26 lines (18 loc) · 738 Bytes

README

calcr is a small calculator that interprets text as a mathematical expression, supporting basic operators (+,-,*,/) and variable substitution.

float result = Calcr.parseFloat("1 + x", "x", 42); // result = 43

Or use multiple variables

Map<String, Float> variables = new HashMap<String, Float>();
variables.put("x", 42f);
variables.put("y", 7f);
float result = Calcr.parseFloat("x / y", variables); // result = 6

Development

git clone git://github.com/platzhaltr/calcr.git
cd calcr
mvn clean install

Related work

  • exp4j Math expression evaluator with support for all Math operators functions and the possibility to create new ones.