Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
66b601bbfd
Commit
36532ccd5d
@ -41,6 +41,9 @@ public class DivideOperator implements Operator {
|
|||||||
if (is(value, Value.StringValue.class, Value.BooleanValue.class) || is(value2, Value.StringValue.class, Value.BooleanValue.class)) {
|
if (is(value, Value.StringValue.class, Value.BooleanValue.class) || is(value2, Value.StringValue.class, Value.BooleanValue.class)) {
|
||||||
throw new IllegalArgumentException("SCRIPT_COMMAND_ARITHMETIC_DIV_ERROR");
|
throw new IllegalArgumentException("SCRIPT_COMMAND_ARITHMETIC_DIV_ERROR");
|
||||||
}
|
}
|
||||||
|
if (value2.asDouble() == 0) {
|
||||||
|
return new Value.DoubleValue(Double.NaN);
|
||||||
|
}
|
||||||
return new Value.DoubleValue(value.asDouble() / value2.asDouble());
|
return new Value.DoubleValue(value.asDouble() / value2.asDouble());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren