Evaluating relations

mXparser - logo

*** If you found the software useful donation is something you might consider 🙂 ***

If you found the software useful donation is something you might consider :-)

JAVA code

Case 1: Binary relation "="

import org.mariuszgromada.math.mxparser.*;
...
Expression e = new Expression("2=3");
mXparser.consolePrintln("Res: " + e.getExpressionString() + " = " + e.calculate());
Res: 2=3 = 0.0

Case 2: Binary relation "<"

import org.mariuszgromada.math.mxparser.*;
...
Expression e = new Expression("2<3");
mXparser.consolePrintln("Res: " + e.getExpressionString() + " = " + e.calculate());
Res: 2<3 = 1.0

Case 3: Boolean operator "OR"

import org.mariuszgromada.math.mxparser.*;
...
Expression e = new Expression("(2=3) | (2<3)");
mXparser.consolePrintln("Res: " + e.getExpressionString() + " = " + e.calculate());
Res: (2=3) | (2<3) = 1.0

Case 4: Boolean operator "AND"

import org.mariuszgromada.math.mxparser.*;
...
Expression e = new Expression("(2=3) & (2<3)");
mXparser.consolePrintln("Res: " + e.getExpressionString() + " = " + e.calculate());
Res: (2=3) & (2<3) = 0.0

*** If you found the software useful donation is something you might consider 🙂 ***

If you found the software useful donation is something you might consider :-)

Enjoy! 🙂

 

Best regards,

Mariusz Gromada

Download latest release – v.4.4.0 Gemoni: bin + doc + src (.zip 12.2 MB)

Download latest release – v.4.4.0 Gemoni: bin only (.zip 10 MB): includes separate binaries for various .NET platforms and Java versions

Source code .zipSource code .tar.gz View on GitHubMathSpace.pl