microsoft / microsoft/calculator
Repeated enter key presses only applies previous binary operator (ignores unary operators)
Nobody has claimed this yet.
- 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

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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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