Summary: | krunner calculator lacks floating point number precision when compiled without qalculate support | ||
---|---|---|---|
Product: | [Plasma] krunner | Reporter: | Zoltan Puskas <zoltan> |
Component: | calculator | Assignee: | Alexander Lohnau <alexander.lohnau> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | asturm, nate, plasma-bugs |
Priority: | NOR | ||
Version: | 5.21.0 | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/plasma-workspace/commit/4c5e454024df728885f42e9757e35d993afa948a | Version Fixed In: | 5.24 |
Sentry Crash Report: |
Description
Zoltan Puskas
2021-02-28 06:06:03 UTC
It seems like you don't have qalculate installed. With that you get the expected result. Otherwise QJSEngine is used to evaluate the result. Hmm, Should we mark this as INTENTIONAL an require qalculate as a hard dependency, or fix the built-in calculation? My preference would be for the former. The downstream plasma-workspace package correctly lists sci-libs/libqalculate as an optional dependency. We can certainly enable that by default, and improve the description in case user is disabling the option. When you run `node` and type in the expression you mentioned it you get a similar result. Messing with the JS engine would seem like a really bad idea. I personally have been thinking that it could make sense to not build this runner at all when qaclulate is not available, it is kindof confusing if you still have the runner, but it does not work as you would expect. Indeed, enabling the +qalculate USE flag for kde-plasma/plasma-workspace does resolve the issue, not sure why I've not noticed this before. As far as I can tell this flag has been around for some years now. I will work with Andreas to have this enabled by default in Gentoo. Should we maybe make qalculate mandatory? If not using it causes this problem, that doesn't seem ideal. (In reply to Alexander Lohnau from comment #4) > I personally have been thinking that it could make sense to not build this > runner at all when qaclulate is not available, it is kindof confusing if you > still have the runner, but it does not work as you would expect. ^ second that. I'd say build the runner conditionally on qalculate. A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/856 Git commit 4c5e454024df728885f42e9757e35d993afa948a by Nate Graham, on behalf of Zoltan Puskas. Committed on 01/01/2022 at 00:52. Pushed by ngraham into branch 'master'. calculatorrunner: Enforce using Qalculate If libqalculate is not present on the system, calculator runner falls back to using QJSEngine, which results in significantly reduced precision. Make calculator runner unconditionally dependent on Qalculate and remove conditional fallback code to QJSEngine. M +5 -0 CMakeLists.txt M +18 -36 runners/calculator/CMakeLists.txt M +0 -5 runners/calculator/autotests/calculatorrunnertest.cpp M +0 -179 runners/calculator/calculatorrunner.cpp M +0 -8 runners/calculator/calculatorrunner.h https://invent.kde.org/plasma/plasma-workspace/commit/4c5e454024df728885f42e9757e35d993afa948a |