Fix another -0 check

Change-Id: I6146e4c41aa08ff4804fa2f37e93186ddc0a2a0f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Erik Verbruggen 2017-06-22 09:37:52 +02:00 committed by Lars Knoll
parent 1d7f082f33
commit c173394036
1 changed files with 2 additions and 2 deletions

View File

@ -236,9 +236,9 @@ bool Value::sameValue(Value other) const {
if (s && os)
return s->isEqualTo(os);
if (isInteger() && other.isDouble())
return int_32() ? (double(int_32()) == other.doubleValue()) : (other._val == 0);
return int_32() ? (double(int_32()) == other.doubleValue()) : !std::signbit(other.doubleValue());
if (isDouble() && other.isInteger())
return other.int_32() ? (doubleValue() == double(other.int_32())) : (_val == 0);
return other.int_32() ? (doubleValue() == double(other.int_32())) : !std::signbit(doubleValue());
return false;
}