microsoft / microsoft/calculator

Repeated enter key presses only applies previous binary operator (ignores unary operators)

Open
#264 9 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Area: User Experience Bug Pri: 2 triage approved
Dominant language
C#
Stars
31.1k
Forks
5.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
Mysterious "+ 1" appears in the history panel after reproducing following steps which leads to an incorrect result.

Click on buttons in a following order to reproduce
a. 1
b. +
c. 1
d. n!
e. = (at this point the calculator shows correct result which is 2)
f. √
g. x2 (at this point the calculator still shows correct result which is 2)
h. = (at this point the calculator shows incorrect result 3 insted of 2 and "+ 1" appears at the end of the expression in the history panel)

Screenshots
obraz

Device and Application Information (please complete the following information):

  • OS Build: 10 0 17134 0
  • Architecture: X64
  • Application Version: 10.1812.10048.0

Additional context
Ones can be replaced with any other natural numbers and issue will still occur.
In that case mysterious "+ 1" after expression will be replaced with "+ whatever the result of previously counted factorial was".

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the sequence 1, +, 1, n!, =, √, x², = and inspect the calculator's operator handling to trace why the second Enter reuses the factorial result as "+ 1". Done means repeated Enter preserves the unary operations, returns 2 for this case, and no extra "+ 1" appears in the history.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.