Evaluating relations

MathParser.org - mXparser - logo - Tutorial

*** 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 "="

2=3

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 "<"

2<3

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"

(2=3)\vee(2<3)

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"

(2=3)\wedge(2<3)

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.0.0.2: bin + doc + src (.zip 10.7 MB)

Download latest release – v.4.0.0.2: bin only (.zip 3.04 MB) – separate binaries for java: 1.5, 1.6, 1.7, 1.8; .NET: 2.0, 3.0, 3.5, 4.0, 4.5, 4.6, .NET Core, .NET Standard, .NET PCL, Xamarin.Android, Xamarin.iOS

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