-
Notifications
You must be signed in to change notification settings - Fork 95
Boolean Operations
pieterderycke edited this page Oct 30, 2014
·
3 revisions
The following boolean operations are supported by Jace.NET:
- Less than: <
- Less than or equal: <= or ≤
- More than: >
- More than or equal: >= or ≥
- Equal: ==
- Not Equal: != or ≠
The boolean operations map true to 1.0 and false to 0.0. All functions accepting a condition will consider 0.0 as false and any other value as true.
Comparing var1 and someOtherVar:
CalculationEngine engine = new CalculationEngine();
Dictionary<string, double> variables = new Dictionary<string, double>();
variables.Add("var1", 2);
variables.Add("someOtherVar", 4.2);
double result = engine.Calculate("var1 <= someOtherVar", variables );