fix NaaN comparisons. Fix #1576
This commit is contained in:
1 parent
52489bab00
commit
4a881264b4
1 file changed
+9
-1
@@ -193,7 +193,15 @@ public class NumericValue extends Value
|
||||
}
|
||||
if (o instanceof final NumericValue no)
|
||||
{
|
||||
return longValue != null && no.longValue != null ? longValue.equals(no.longValue) : !this.subtract(no).getBoolean();
|
||||
if (longValue != null && no.longValue != null)
|
||||
{
|
||||
return longValue.equals(no.longValue);
|
||||
}
|
||||
if (Double.isNaN(this.value) || Double.isNaN(no.value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return !this.subtract(no).getBoolean();
|
||||
}
|
||||
return super.equals(o);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user