diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2019-09-02 18:36:24 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-09-04 18:42:55 +0200 |
commit | 893a298a9c66af9aa2a87d9ba5e805967bade405 (patch) | |
tree | d1f976da1971a3dfa186a12c8f15d4bbbfd3609c | |
parent | f862b3edeb8a96a49a5d12620506d33d5a5aadca (diff) |
Use quiet NaNs instead of signalling ones
I see no good reason why the NaN returned when reading "nan" as a
double should be a signalling one; a quiet one should be just fine.
[ChangeLog][ES][] The NaN obtained by Math.pow(+/-1, +/-infinity) and
(+/-1)**(+/-infinity) is now quiet rather than signalling.
Change-Id: I6b5ea469c17c028328c803f54f2a6d4422a80033
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4vme_moth.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 8a7cbdfb2a..aaa198c62a 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -2050,7 +2050,7 @@ ReturnedValue Runtime::Exp::call(const Value &base, const Value &exp) double b = base.toNumber(); double e = exp.toNumber(); if (qt_is_inf(e) && (b == 1 || b == -1)) - return Encode(qt_snan()); + return Encode(qt_qnan()); return Encode(pow(b,e)); } diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp index b4c34d60fa..4d099d2e0f 100644 --- a/src/qml/jsruntime/qv4vme_moth.cpp +++ b/src/qml/jsruntime/qv4vme_moth.cpp @@ -1247,7 +1247,7 @@ QV4::ReturnedValue VME::interpret(CppStackFrame *frame, ExecutionEngine *engine, double base = left.toNumber(); double exp = ACC.toNumber(); if (qIsInf(exp) && (base == 1 || base == -1)) - acc = Encode(qSNaN()); + acc = Encode(qQNaN()); else acc = Encode(pow(base,exp)); MOTH_END_INSTR(Exp) |