Bug 496343

Summary: Formulas with string expressions are not commutative: "sqrt(2) + 2" works, but "2 + sqrt(2)" fails
Product: [Plasma] krunner Reporter: postix <postix>
Component: calculatorAssignee: Plasma Bugs List <plasma-bugs-null>
Status: REPORTED ---    
Severity: normal CC: alexander.lohnau, natalie_clarius, nate
Priority: NOR    
Version First Reported In: 6.2.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description postix 2024-11-16 13:48:31 UTC
STEPS TO REPRODUCE
1. Open krunner, type: 1 + sqrt(2) or 1 + sin(2)
2.  Try the same with sqrt(2) + 1 or sin(2) + 1

OBSERVED RESULT
1. It asks to search with $websearchengine 
2. It calculates correctly

Works fine with qalculate-qt, which uses the same lib.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20241114
KDE Plasma Version: 6.2.3
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0
Comment 1 Nate Graham 2024-11-19 19:11:48 UTC
This is an issue in Libqalculate, which is the library we use for mathematical calculations under the hood. Can you report this at https://github.com/Qalculate/libqalculate/issues? Thanks!
Comment 2 postix 2024-11-19 20:37:56 UTC
(In reply to Nate Graham from comment #1)
> This is an issue in Libqalculate, which is the library we use for
> mathematical calculations under the hood. Can you report this at
> https://github.com/Qalculate/libqalculate/issues? Thanks!

As I wrote
> Works fine with qalculate-qt, which uses the same lib.

two things come in my mind: this is either a regression in Libqalculate, no one has reported yet OR this is a parsing error in krunner and I assume it's the latter.
Comment 3 Nate Graham 2024-11-20 20:39:43 UTC
Eek, sorry for missing that part.