SUMMARY For some calculations, the calculator displays a bounding interval for the answer, like `interval(1.386294361119890, 1.386294361119891)`. This is difficult to read at a glance. Ideally, krunner would display a result rounded to the appropriate number of significant figures. STEPS TO REPRODUCE 1. Type `=log(4)` in krunner OBSERVED RESULT The output is `interval(1.386294361119890, 1.386294361119891)` with `Approximation` written beside it in greyed-out text. EXPECTED RESULT Since we have so many digits after the decimal point, there seems to be no harm in outputting something like `1.38629436111989`, while still noting that it is an approximation. SOFTWARE/OS VERSIONS Linux distro: Arch Linux KDE Plasma Version: 5.16.90 KDE Frameworks Version: 5.62 Qt Version: 5.13.1
The interval notation is a 'feature' of qalculate. It doesn't happen when using the JavaScript-based computation.
Created attachment 124480 [details] Unreadable output because of interval print I have the same problem, additionally for some calculations the result is completely unreadable because of the interval representation, as seen in the attached screenshot. I would suggest to only print the significant digits, an alternative would be, to print the midpoint of the interval. As libqalculate already has options for other representations [1, 2], the change would only be to set another representation in the print options of the qalculate module of krunner. I successfully tried the relevant change on my system with printing only the significant digits and can make a patch for it. SOFTWARE/OS VERSIONS Linux distro: Manjaro Linux KDE Plasma Version: 5.17.4 KDE Frameworks Version: 5.64 Qt Version: 5.13.2 [1] https://qalculate.github.io/reference/structPrintOptions.html#ae940631420bfaa5da009fccb5c3a78b9 [2] https://qalculate.github.io/reference/includes_8h.html (enum IntervalDisplay)
Git commit e374492d24f467187faebe7915c12a6d639a5cd6 by Nate Graham, on behalf of Lukas Pichler. Committed on 07/01/2020 at 16:11. Pushed by ngraham into branch 'master'. Change krunner calculator to display significant digits Summary: Change the qalculate krunner module to print only significant digits instead of an interval as this is sometimes unreadable. FIXED-IN: 5.18.0 Test Plan: Before this change: {F7828390} After: {F7828389} Reviewers: broulik, #plasma Reviewed By: broulik, #plasma Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D26149 M +3 -0 runners/calculator/qalculate_engine.cpp https://commits.kde.org/plasma-workspace/e374492d24f467187faebe7915c12a6d639a5cd6