| Summary: | KRunner can give erroneous output when evaluating equations involving implicit mutiplication | ||
|---|---|---|---|
| Product: | [Plasma] krunner | Reporter: | Aaron Rainbolt <arraybolt3> |
| Component: | calculator | Assignee: | Plasma Bugs List <plasma-bugs-null> |
| Status: | CONFIRMED --- | ||
| Severity: | normal | CC: | alexander.lohnau, natalie_clarius, nate |
| Priority: | NOR | ||
| Version First Reported In: | 5.27.7 | ||
| Target Milestone: | --- | ||
| Platform: | Ubuntu | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Aaron Rainbolt
2023-08-23 07:26:51 UTC
Sounds good! Wanna submit a merge request to do that? I was working on it last night, but isma pointed out (in the Plasma dev room) that KRunner supports unknown variables when solving equations (for instance you can type =2x=5 and it will tell you that x = 2.5). Setting conventional mode would cause the expression 1/2x to be parsed as 1/(2x) rather than (1/2)x. Perhaps this isn't actually a bug? If a user doesn't want the implicit multiply to be applied first, they can make it explicit by inserting a * where it belongs, or they can use extra parentheses. Worthy of note, libqalculate's Adaptive mode (which I *think* we're using now) allows an easy way of disambiguating this kind of expression: 1/2x is parsed as 1/(2x), but 1/2 x (notice the space) is parsed as (1/2)x. However when inserting a space into the equation in KRunner (as =6/2 (2+1)), the result is still 1. That may actually be a bug, however I'm unsure if fixing it would help matters much since I don't think most users will know about this interesting libqalculate behavior and be able to use it to their advantage. Sounds like our options are to submit an MR or close this as RESOLVED INTENTIONAL. Your call. :) |