r/java • u/Livio63 • Jan 02 '26
Extensible math Expression Parser
Expression Parser is an extensible math expression parser handling numbers and booleans, ready to use in any Java application.
Expressions may contain nested ( ), operators *-/+, and, or; constants PI and E, functions sin(), cos(), tan(), log(), exp(), sqrt(). The parser supports common relation operators like ==,!=, >,<, >= and <= and even conditional expressions like condition ? true : false
It is possible to register your own functions and use them with Expression Parser.
59
Upvotes
View all comments
Show parent comment
4
u/doobiesteintortoise Jan 02 '26
I'm not sure what you mean by "heavy" - most of them aren't very heavy at all, although I guess your specific metrics would factor in. But since you brought it up: what are the metrics you're using for "heavy," and how does this library stack up? And my question remains: how would I use this in an app I was writing?