microsoft / calculator

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

Incorrect Exponent Calculation #2201

Open thisUserX opened 4 months ago

thisUserX commented 4 months 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 4 months ago

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

Emmasnow0022 commented 1 week ago

Forge Rechner is your essential companion for optimizing crafting strategies and material management. Streamline your forging process and unlock new possibilities in your creations with precise calculations and insights.

mdtauk commented 1 week ago

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.

There is a difference between the Standard calculator which handles each calculation in isolation, and the Scientific calculator which uses the order of operations

Image