Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public static ConstantExpression createFloat(String text) {
if (value > Double.MAX_VALUE) {
throw new RuntimeException(text + " is greater than " + Double.MAX_VALUE);
}
if (value < Double.MIN_VALUE) {
throw new RuntimeException(text + " is less than " + Double.MIN_VALUE);
if (value < -Double.MAX_VALUE) {
throw new RuntimeException(text + " is less than " + -Double.MAX_VALUE);
}
return new ConstantExpression(value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,17 @@ public void testEvaluate_floatNumber() throws Exception {
eval(expression, context, Boolean.TRUE);
}

@Test
public void testEvaluate_zeroFloatNumber() throws Exception {
Expression expression = genExp("a = 0.0");

EvaluationContext context = genContext(
KeyValue.c("a", "0.0")
);

eval(expression, context, Boolean.TRUE);
}

@Test
public void testEvaluate_twoVariable() throws Exception {
Expression expression = genExp("a > b");
Expand Down
Loading