[Feature Request] New greater than or equal to operator
Summary
I would like to be able to check a placeholder variable, for example an McMMO level, is greater than or equal to a certain amount to conditionally allow for new skills to be used.
Usage
Players should be able to conditionally check if an integer checked via variable placeholders is greater than or equal to a certain value to determine whether or not additional skills can be used.
Value
More flexibility
Priority
High, great feature
Implementation
As suggested on the operator page, I should raise a new issue:
exp4j Built in operators Example 9 Create a custom operator logical operator that returns 1 if the first argument is greater or equals than the second argument, and otherwise it returns 0.
`@Test public void testOperators3() throws Exception { Operator gteq = new Operator(">=", 2, true, Operator.PRECEDENCE_ADDITION - 1) {
@Override
public double apply(double[] values) {
if (values[0] >= values[1]) {
return 1d;
} else {
return 0d;
}
}
};
Expression e = new ExpressionBuilder("1>=2").operator(gteq)
.build();
assertTrue(0d == e.evaluate());
e = new ExpressionBuilder("2>=1").operator(gteq)
.build();
assertTrue(1d == e.evaluate());`