diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2022-07-29 16:12:24 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-08-03 08:19:54 +0200 |
| commit | d8db6e9484884f9d93ef584e63e695ae0322fc8f (patch) | |
| tree | ba6a525b1cdd0aca8dcbb449d7a3e87042dd5554 /src/qml/jsruntime/qv4runtime.cpp | |
| parent | b44c06dbc726d81481a0c6e28060ed3b3c9d4ecf (diff) | |
V4: Fix exponentiation operator
We need to use the same algorithm as for Math.pow(...). Since we have
jsExponentiate() now, we can use it in all those places. The strange AIX
special case is definitely not useful anymore.
Task-number: QTBUG-105188
Change-Id: I43a251c71f1b547ad36855ac197080bfea8c94e3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index bd81c56bbd..71892454d2 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -2113,9 +2113,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_qnan()); - return Encode(pow(b,e)); + return Encode(QQmlPrivate::jsExponentiate(b, e)); } ReturnedValue Runtime::BitAnd::call(const Value &left, const Value &right) |
