#1089712 kcalc: Repeatedly using the same operator produces false results

Package:
kcalc
Source:
kcalc
Description:
simple and scientific calculator
Submitter:
datenritter
Date:
2024-12-11 16:21:02 UTC
Severity:
normal
#1089712#5
Date:
2024-12-11 16:12:21 UTC
From:
To:
Dear Maintainer,

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 (e.g. "1, +, 1, Enter"), the result is correct.

OBSERVED RESULT
Using an operator twice skips one operation. History shows the operation and operands, but wrong results.

EXPECTED RESULT
Using an operator twice should repeat the operation on the operand visible in the entry field as it does on any other calculator. History should show correct results for displayed calculations.


I consider this important, not just normal, as math is core functionality of a calculator.