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 plugin Incorrectly displays results for 2 ^ 64 #32014

Open
reed-hayden opened this issue Mar 21, 2024 · 3 comments
Open
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 Run-Plugin Things that relate with PowerToys Run's plugin interface

Comments

@reed-hayden
Copy link

Microsoft PowerToys version

0.79.0

Installation method

WinGet

Running as admin

No

Area(s) with issue?

PowerToys Run

Steps to reproduce

  1. Open PowerToys Run
  2. Enter 2 ^ 64
  3. Observe result

The picture below show both the native calculator app and powertoys run in the same image

IncorrectAns

✔️ Expected Behavior

The result should show 18446744073709551616

❌ Actual Behavior

The result shown is: 18446744073709600000

Note: You can also get incorrect answers by typing in 2^ 51, 2^ 52 ... etc

Other Software

No response

@reed-hayden reed-hayden added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Mar 21, 2024
@davidegiacometti davidegiacometti added Product-PowerToys Run Improved app launch PT Run (Win+R) Window Run-Plugin Things that relate with PowerToys Run's plugin interface labels Mar 21, 2024
@davidegiacometti
Copy link
Collaborator

It looks like an overflow issue.

@htcfreek
Copy link
Collaborator

This is a limitation of the "mages" calculation library. It's known but I don't know if we have an existing tracking issue.

It is caused by the number data types used in the library. There were changes in the past to improve the correctness but more correctness is impossible from what I know.

@arphox
Copy link

arphox commented Apr 9, 2024

I also experienced this when trying to calculate 2^63-1 to get System.Int64 maxvalue.

9223372036854780000 is what the tool wrote, but
9223372036854775807 is the correct value.

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 Run-Plugin Things that relate with PowerToys Run's plugin interface
Projects
None yet
Development

No branches or pull requests

4 participants