microsoft / calculator

Windows Calculator: A simple yet powerful calculator that ships with Windows
MIT License
29.35k stars 5.31k forks source link

Incorrect Exponent Calculation #2201

Open thisUserX opened 3 weeks ago

thisUserX commented 3 weeks ago

Describe the bug

Calculating 2^2^2^2 produces 256 as the answer. The correct answer should be 65536. Order of operations dictate that the highest exponent should be calculated first as if there were parenthesis like (2^(2^(2^2))).

Steps To Reproduce

  1. Go to calculator
  2. enter 2^2^2^2
  3. See incorrect calculation of 256

Expected behavior

This should be calculated properly as 65536

Screenshots

Device and Application Information

Additional context

This problem exists with all tested numbers (not just 2). The error is in calculating the exponents from left to right instead of right to left.

Requested Assignment

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

KylePowell1 commented 3 weeks ago

There is no mistake. Every result of the calculator is defaulted to be enclosed in parentheses.