Calculator freezes when attempting to evaluate many nested parentheses

Open
#2,271 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Reproduce the reported expression on Windows 10 with Calculator 11.2411.1.0, comparing 11 nested levels with 12 and a 13th parenthesis. Trace the calculator's expression-evaluation path from that reproduction; done means the nested expression evaluates without freezing when submitted with = or Enter.

Written by the indexing model from the issue text.

Description

Describe the bug

When evaluating an expression with 12 levels of nested parentheses, each level with two operators, if you have tried to add a 13th level of parentheses, the calculator freezes. With 11 levels, it works fine. (The number of levels of nested parentheses can be seen on the left parenthesis button)

Steps To Reproduce

  1. Enter in 1 + 1 / (2 + 1 / (1 + 1 / (2 + 1 / (1 + 1 / (2 + 1 / (1 + 1 / (2 + 1 / (1 + 1 / (2 + 1 / (1 + 1 / (2 + 1 / (1 + 1 / 1
  2. Try to add a 13th level of parenthesis
  3. Hit = or Enter
  4. Calculator freezes
    Expected behavior

The expression would be evaluated without any issues.

Screenshots

Image

Device and Application Information

  • OS Build: Windows 10 Home build 19045.5427
  • Architecture: 64-bit
  • Application Version: 11.2411.1.0
  • Region: en-US
  • Dev Version Installed: None

Additional context

Requested Assignment

I'm just reporting this problem. I don't want to fix it.

Dominant language
C#
Stars
31.1k
Forks
5.8k
PR merge metrics
No merged PRs in 30d

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.

More from microsoft/calculator

All issues in microsoft/calculator

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.