Bug 497283

Summary: Repeatedly using the same operator produces false results
Product: [Applications] kcalc Reporter: datenritter <track-kdebugs>
Component: generalAssignee: Evan Teran <evan.teran>
Status: RESOLVED FIXED    
Severity: grave CC: gabriel.barrantes.dev
Priority: NOR    
Version First Reported In: 22.12.3   
Target Milestone: ---   
Platform: Debian stable   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: KCalc window showing wrong results

Description datenritter 2024-12-10 16:54:46 UTC
Created attachment 176495 [details]
KCalc window showing wrong results

SUMMARY

Pressing e.g. + or * repeatedly to add or multiply the same number leads to wrong results.


STEPS TO REPRODUCE
1. Activate scientific mode. Turn history on.
2. Type "1, +, Enter". Result is 2, History will show: "1 + 1 = 2" which is correct.
3. Type "1, +, +, Enter". Result is 2, should be 3, History will show: "1 + 1 + 1  = 2" which is wrong.
4. Type "1, +, +, 2, Enter." Result is 3, should be 4, History will show: "1 + 1 + 2 = 3" which is wrong.

The same happens with * .

If you retype the operand, the results are correct.

OBSERVED RESULT
Using an operator twice doesn't work properly. History shows correct operations and operands, but wrong results.

EXPECTED RESULT
Using an operator twice should repeat the operation on the operand in the entry field.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian 12 stable.
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Comment 1 Gabriel Barrantes 2024-12-11 00:04:27 UTC
22.12.3 is a really old version, try the latest.