A Java project (perhaps a library once it gets competent enough) for parsing and interpreting math equations.
Currently running the main class brings up a REPL, which can be used for entering equations or running a little benchmark:
In code:
String equation = "((3 - 8 / (1 - 10 * (5)) * 4) / 3) * 8 / 5 / 1";
int wantedDecimalPlaces = 30;
Tokenizer tokenizer = new Tokenizer(equation, wantedDecimalPlaces);
Token topOfAST = Parser.parseTokens(tokenizer.getTokens(), tokenizer.getMathContext());
topOfAST.
eval(); // returns BigDecimal: "1.94829931946666666666666666667"
BigDecimal instead of Doubles for accuracy(Done)- more error prone to unorthodox equations (e.g. "2---1" could be evaluated as "2-(-(-1))")
- more operators
- trigonometric functions support
*an anagram for "parse math"