Bug 432377 - KRunner calculator wrongly interpret hex numbers starting with digit as multiplication
Summary: KRunner calculator wrongly interpret hex numbers starting with digit as multi...
Status: RESOLVED FIXED
Alias: None
Product: krunner
Classification: Plasma
Component: calculator (show other bugs)
Version: 5.20.5
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Alexander Lohnau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-01 11:50 UTC by Mykola Krachkovsky
Modified: 2021-02-01 11:59 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.21
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mykola Krachkovsky 2021-02-01 11:50:36 UTC
SUMMARY

KRunner's calculator seems interpret hex numbers starting with digit as a multiplication leading to zero result.

STEPS TO REPRODUCE
1. Open KRunner
2. Type `=0x20`

OBSERVED RESULT
0

EXPECTED RESULT
32

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20210130
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Kernel Version: 5.10.9-1-default
OS Type: 64-bit

ADDITIONAL INFORMATION

It seems krunner's calculator may interpret `x` as multiplication, e.g. `=4x5`->`20`. If this is needed for anyone, still `0x4` as multiplication is pointless, so IMHO, it's better to keep `0x` prefix just for hex numbers and interpret `x` as multiplication only when there is non-zero value before `x`.
Comment 1 Alexander Lohnau 2021-02-01 11:57:06 UTC
Already fixed with https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/571
Comment 2 Mykola Krachkovsky 2021-02-01 11:59:20 UTC
Thanks!