Menu
Home Explore People Places Arts History Plants & Animals Science Life & Culture Technology
On this page
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.

We don't have any images related to Exp4j yet.
We don't have any YouTube videos related to Exp4j yet.
We don't have any PDF documents related to Exp4j yet.
We don't have any Books related to Exp4j yet.
We don't have any archived web articles related to Exp4j yet.

Features

  • Variables can be used in expressions
  • exp4j comes with a set of common built-in functions
  • Users can create and use their own custom operators
  • Users can create and use their own custom functions

License terms

exp4j is released under the terms of the Apache License 2.0

Examples of usage

Calculating the result of 3 ∗ sin ⁡ ( π ) − 2 e {\displaystyle 3*{\frac {\sin {(\pi )}-2}{e}}} can be done in the following way:

Expression e = new ExpressionBuilder("3 * (sin(pi) - 2 )/ e") .variables("pi", "e") .build() .setVariable("pi", Math.PI) .setVariable("e", Math.E); double result = e.evaluate();

See also

  • mXparser - Mathematical Expressions Parser / Evaluator

References

  1. "Maven Central Repository Search". search.maven.org. Retrieved 2022-03-16. https://search.maven.org/artifact/net.objecthunter/exp4j/0.4.8/jar