aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4mathobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4mathobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4mathobject.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4mathobject.cpp b/src/qml/jsruntime/qv4mathobject.cpp
index e176235786..2943df2984 100644
--- a/src/qml/jsruntime/qv4mathobject.cpp
+++ b/src/qml/jsruntime/qv4mathobject.cpp
@@ -396,8 +396,10 @@ ReturnedValue MathObject::method_max(const FunctionObject *, const Value *, cons
double mx = -qt_inf();
for (int i = 0, ei = argc; i < ei; ++i) {
double x = argv[i].toNumber();
- if (x > mx || std::isnan(x))
+ if ((x == 0 && mx == x && copySign(1.0, x) == 1.0)
+ || (x > mx) || std::isnan(x)) {
mx = x;
+ }
}
RETURN_RESULT(Encode::smallestNumber(mx));
}