Exp4j


exp4j is a small Java library for evaluation of mathematical expressions. It implements Dijkstra's Shunting-yard algorithm to translate expressions from infix notation to Reverse Polish notation and calculates the result using a simple Stack algorithm.

Features

License terms

exp4j is released under the terms of the Apache License 2.0

Examples of usage

Calculating the result of
can be done in the following way:

Expression e = new ExpressionBuilder
.variables
.build
.setVariable
.setVariable;
double result = e.evaluate;