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 return error result when calculate hexadecimal numbers #29632

Closed
zsynacl opened this issue Nov 2, 2023 · 6 comments
Closed

PowerToys Run return error result when calculate hexadecimal numbers #29632

zsynacl opened this issue Nov 2, 2023 · 6 comments
Assignees
Labels
Issue-Bug Something isn't working Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. Run-Plugin Things that relate with PowerToys Run's plugin interface

Comments

@zsynacl
Copy link

zsynacl commented Nov 2, 2023

Microsoft PowerToys version

0.75.1

Installation method

PowerToys auto-update

Running as admin

Yes

Area(s) with issue?

PowerToys Run

Steps to reproduce

input:

=0xf4572220-0xf4572410
or
=0xf4572220 - 0xf4572410
or
0xf4572220 - 0xf4572410

✔️ Expected Behavior

expected result
-496
or
FFFFFFFFFFFFFE10

❌ Actual Behavior

output: -2048

image

Other Software

No response

@zsynacl zsynacl added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Nov 2, 2023
@jaimecbernardo
Copy link
Collaborator

This does look weird...

@jaimecbernardo jaimecbernardo added Run-Plugin Things that relate with PowerToys Run's plugin interface and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Nov 2, 2023
@jaimecbernardo
Copy link
Collaborator

image

@zsynacl
Copy link
Author

zsynacl commented Nov 4, 2023

image

So I guess it's because the number overflows MAX. Like another problem I found in #28085 .

I think it is not a good idea to calculate hexademical numbers using float or double, just uint64_t would be fine.

@ukanuk
Copy link

ukanuk commented Nov 30, 2023

Would have to use int64_t in order to get a negative result right, not uint64_t?

@zsynacl
Copy link
Author

zsynacl commented Dec 25, 2023

Would have to use int64_t in order to get a negative result right, not uint64_t?

Consider that numbers start with "0x" should not be treated as negative value, maybe we should imporve this specific case first.

The original use case is that as a programer, I prefer use powertoy run instead of calculator provided by windows to calculate some hexademical or binary mathematical calculations. Because it's just more handy 😆 .

@stefansjfw stefansjfw self-assigned this Jan 26, 2024
@stefansjfw stefansjfw added Status-In progress This issue or work-item is under development Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed Status-In progress This issue or work-item is under development labels Jan 26, 2024
@jaimecbernardo
Copy link
Collaborator

Hi, this has been worked on for the 0.78 development cycle. 😄
Please update PowerToys to the latest: https://github.com/microsoft/PowerToys/releases

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 Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. Run-Plugin Things that relate with PowerToys Run's plugin interface
Projects
None yet
Development

No branches or pull requests

4 participants