using org.mariuszgromada.math.mxparser;
public static class TestMXParser
public static void Main()
string formula = "ceil((((n * 1.35) / 1000) * 5) / 25) * 25";
string functionSignature = "f(n)";
string functionWithValue = "f(52000)";
string functionWithFormula = functionSignature + " = " + formula;
Function f = new Function(functionWithFormula);
Expression e = new Expression(functionWithValue,f);
e.setDescription("Example - verbose mode");
mXparser.consolePrintln("Attempting to evaluate: " + functionWithFormula);
mXparser.consolePrintln("Res: " + e.getExpressionString() + " = " + e.calculate());
mXparser.consolePrintln("checkSyntax = " + e.checkSyntax());
mXparser.consolePrintln(e.getErrorMessage());
mXparser.consolePrintln("checkLexSyntax = " + e.checkLexSyntax());