-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Comments
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.
|
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. |
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: With brackets: |
Eek... I knew that... brainfart sorry! |
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.
✔️ Expected Behavior
the correct result of 0.39995 is returned
❌ Actual Behavior
It's giving a result of 159.98.
Other Software
No response
The text was updated successfully, but these errors were encountered: