STEPS TO REPRODUCE 1. In the calculator widget, multiply 62 x 1.3. OBSERVED RESULT The calculator widget gives the answer "8.06e1". EXPECTED RESULT The answer should be "80.6". SOFTWARE/OS VERSIONS OS: KDE neon 5.16 User Edition KDE Plasma Version: 5.16.4 KDE Frameworks Version: 5.61.0 Qt Version: 5.12.3
Wow.
"8.06e1" is theoretically correct (8.06 x 10^1 = 80.6), but it is not necessary to use scientific notation in this case because the widget has enough space to display the number.
Since it is using binary instead of decimal arithmetic, the result is probably 80.6000000000000001 or something similar. For "long" results, it decides to use scientific notation. It should always round to 15 significant decimal digits before any further processing, because IEEE double precision is limited. I haven't checked if number.toString() offers options for precision. https://cgit.kde.org/kdeplasma-addons.git/tree/applets/calculator/package/contents/ui/calculator.qml#n244
Is this issue still on to work on this?
Yes, please feel free to work on this if you'd like!
(In reply to Nate Graham from comment #5) > Yes, please feel free to work on this if you'd like! Yes I would like to work on this issue. Please assign this issue to me. Thanks!!
(In reply to Nate Graham from comment #5) > Yes, please feel free to work on this if you'd like! What is the mailing list or IRC Channel for this project where I can discuss my doubts and ask questions?
plasma-devel@kde.org
Can I get the link of few resources to learn Qt. Actually I am new to KDE so I have just set up the development environment and I tried to learn Qt, but I can't find some good resources?
(In reply to Nisarg from comment #9) > Can I get the link of few resources to learn Qt. Actually I am new to KDE so > I have just set up the development environment and I tried to learn Qt, but > I can't find some good resources? https://community.kde.org/Get_Involved/development#New_to_C.2B.2B.2FQt_software_development.3F
>I haven't checked if number.toString() offers options for precision. No, it doesn't.
Git commit a51086867c0f0f7e19b0dd2b9d59657542c46901 by David Edmundson. Committed on 15/01/2020 at 00:36. Pushed by davidedmundson into branch 'master'. [applets/calculator] Use Qt's in-built number formatting Summary: Gets rid of a load of code. Correctly handles floating point issues. Results are correct. Potentially this inadvertedly introduces a behaviour change of including group separators depending on locale. This could be considered a good thing, but if it's problematic we can always add a .replace() at the end of this line. Test Plan: 62 * 1.3 = 80.6 100000000 * 5000000 = 5e+17 (with whatever the right number of zeroes is) 42 * 1.33333 = 6.6666665 Reviewers: #plasma Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D26676 M +2 -18 applets/calculator/package/contents/ui/calculator.qml https://commits.kde.org/kdeplasma-addons/a51086867c0f0f7e19b0dd2b9d59657542c46901