Bug 419775 - precedence is wrong for unary operator
Summary: precedence is wrong for unary operator
Status: RESOLVED FIXED
Alias: None
Product: kcalc
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Evan Teran
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-07 01:31 UTC by Michael Tsang
Modified: 2021-06-13 20:42 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.