Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PowerToys Run Calculator incorrect result on basic multiplication/division operation #37725

Closed
minig0d opened this issue Mar 2, 2025 · 4 comments
Labels
Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Product-PowerToys Run Improved app launch PT Run (Win+R) Window

Comments

@minig0d
Copy link

minig0d commented Mar 2, 2025

Microsoft PowerToys version

0.88.0

Installation method

PowerToys auto-update

Running as admin

Yes

Area(s) with issue?

PowerToys Run

Steps to reproduce

Type in "399.95/5020" or "=399.95/5020" (without the quotes). It's giving a result of 159.98.

If I change it to"399.95/(5020)" or "=399.95/(5020)", the correct result of 0.39995 is returned.

Image
Image
Image
Image

✔️ Expected Behavior

the correct result of 0.39995 is returned

❌ Actual Behavior

It's giving a result of 159.98.

Other Software

No response

@minig0d minig0d added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Mar 2, 2025
Copy link

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

@vanzue vanzue added the Product-PowerToys Run Improved app launch PT Run (Win+R) Window label Mar 3, 2025
@minig0d
Copy link
Author

minig0d commented Mar 3, 2025

I reviewed the issues that the AI bot found and I don't believe any of them are the same issue. I tested the math in them and all of them work fine for me. Almost all of them appear to be because of some type of error with the Language/Regional settings (the computer set to a language that uses the comma as a decimal separator). My issue is occurring on an US English language windows 10 install.

@daverayment
Copy link
Contributor

daverayment commented Mar 3, 2025

Hi @minig0d. This is because the order of mathematical operations follows the standard BODMAS rule, where Brackets are evaluated before Division or Multiplication. The difference between your two examples is that in the second, the 50 * 20 is evaluated before the division, so 399.95 is divided by 1000. In the first example, 399.95 is divided by 50 and then that result is multiplied by 20.

Any calculator will give you the same answers. For example, Windows Calculator in Scientific mode:

Without brackets:

Image

With brackets:

Image

@minig0d
Copy link
Author

minig0d commented Mar 4, 2025

Hi @minig0d. This is because the order of mathematical operations follows the standard BODMAS rule, where Brackets are evaluated before Division or Multiplication. The difference between your two examples is that in the second, the 50 * 20 is evaluated before the division, so 399.95 is divided by 1000. In the first example, 399.95 is divided by 50 and then that result is multiplied by 20.

Eek... I knew that... brainfart sorry!

@minig0d minig0d closed this as completed Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Product-PowerToys Run Improved app launch PT Run (Win+R) Window
Projects
None yet
Development

No branches or pull requests

3 participants