Pointer equality between Doubles does not seem like a good idea.
This commit is contained in:
@@ -145,8 +145,8 @@ public abstract class Arithmetic extends MultiOperator
|
|||||||
@Override
|
@Override
|
||||||
public Object evaluate (Object[] operands)
|
public Object evaluate (Object[] operands)
|
||||||
{
|
{
|
||||||
for (int i = 1; i < operands.length; i ++) {
|
for (int ii = 1; ii < operands.length; ii ++) {
|
||||||
if (NUMERICAL.apply(operands[i]) == Double.valueOf(0)) {
|
if (Double.valueOf(0).equals(NUMERICAL.apply(operands[ii]))) {
|
||||||
return new NoValue("Division by zero in: " + StringUtil.toString(operands));
|
return new NoValue("Division by zero in: " + StringUtil.toString(operands));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user