microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
111.38k stars 6.56k forks source link

number calculation error in powertoys run #28085

Open zsynacl opened 1 year ago

zsynacl commented 1 year ago

Microsoft PowerToys version

0.72.0

Installation method

GitHub, PowerToys auto-update

Running as admin

Yes

Area(s) with issue?

PowerToys Run

Steps to reproduce

  1. activate power toys run by key shortcut
  2. enter =2^50

✔️ Expected Behavior

expected answer is 1125899906842624

❌ Actual Behavior

actual answer is 1125899906842620

actually, any answer of 2^x would not be multiply of 10. under any x >= 50, answer from powertoys run will be a wrong answer. I guess the floating-point number introduced errors. But if the error could not be avoided, users should be notified explicitly on the UI.

Other Software

windows calculator(11.2210.0.0): 1,125,899,906,842,624

python 3.8.10: python -c "print(2**50)" shows 1125899906842624

GhostVaibhav commented 5 months ago

I think this is an issue with the external dependency "Mages" since that is used in the background to compute the result. Mind if you can check @Jay-o-Way?

Jay-o-Way commented 5 months ago

Possible. But I'm not so familiar with that. @htcfreek works more on Run and its plug-ins. Otherwise I would ping @crutkas for the MS Calc engine issue.

GhostVaibhav commented 5 months ago

I guess, now you pinged both😅

htcfreek commented 5 months ago

This os caused by the number format used in mages.

GhostVaibhav commented 5 months ago

@htcfreek Can you add the "External Dependency" label?

crutkas commented 5 months ago

This is still mage, this is a signed vs unsigned issue.

mrbeardad commented 4 months ago

Maybe the calculator use the double float instead of big int image

mrbeardad commented 4 months ago

It is very very very difficult to troubleshoot problems caused by calculator errors!!!! I think the calculator should be disabled until the bug has been fixed.