-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
[Run, tracker] calculator (mage nuget) having calculation issues #3697
Comments
Maybe the math code of the open-sourced Windows Calculator could be a good fit here, because it has solved problems like in example 1. It is written in C++, though, and I don't know how much work would be required for using it outside calc.exe. |
This is probably gonna sound like a rookie comment, but using open source Windows code that is already out there, sounds pretty obvious to me. Re-inventing things that already have been made in/for a similar situation sounds like a lot of "wasted" time and energy? 🤓 |
This comment has been minimized.
This comment has been minimized.
xref #3764 |
in calculator plugin, Mages looks like it is doing some type of odd casting. Works
Incorrect
var result = MagesEngine.Interpret(query.Search); is what does the calc. |
This should be resolved in our 0.21.1 release of PowerToys. https://github.com/microsoft/PowerToys/releases/tag/v0.21.1 to download it. |
Environment
Example 1 : digits after the decimal point
Example: type "123 * 4.56"
Result = 560,8800000000001
Probably an an issue with the signing of the number, since the total amount of digits is 16, or converting binary to decimal. When using one negative number, the result = -560,8800000000001.
Example 2 : no operator
Example: type "123 456"
Result = 56088
No operator is used here. I know that multliplication may be implied between numbers and constants, or between numbers and (other things in) brackets, but not between numbers only. Also, spaces may sometimes be used in big numbers as thousands separators.
Suggestion: Spaces between only numbers should be ignored (like treated as thousands separators). Unless somebody else has a better idea?
The text was updated successfully, but these errors were encountered: