Bug 419775

Summary: precedence is wrong for unary operator
Product: [Applications] kcalc Reporter: Michael Tsang <miklcct>
Component: generalAssignee: Evan Teran <evan.teran>
Status: RESOLVED FIXED    
Severity: normal CC: bugseforuns, oleg.popkov
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Michael Tsang 2020-04-07 01:31:22 UTC
SUMMARY

The calculator messes up with the precedence with unary operators in scientific mode.

Assume that I want to calculate 1/(1/12+1/6). The expected result is 4.

STEPS TO REPRODUCE
Click the buttons below in sequence
( 1 2 1/x + 6 1/x ) 1/x

OBSERVED RESULT
The screen displays 0 after +, 0.166666666667 after ), and 6 after the final 1/x


EXPECTED RESULT
The screen displays 0.0833333333333 after +, 0.25 after ), and 4 after the final 1/x

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Ubuntu 19.10
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 5.67.0
Qt Version: 5.12.4

ADDITIONAL INFORMATION
Comment 2 Patrick Silva 2021-06-13 20:42:15 UTC
The patch was merged.