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

Bug in Percent Operator #208

Open
mb-real opened this issue Jul 3, 2021 · 1 comment
Open

Bug in Percent Operator #208

mb-real opened this issue Jul 3, 2021 · 1 comment

Comments

@mb-real
Copy link

mb-real commented Jul 3, 2021

for example:
-200-(-200%) = -600 false | true -198

-200-(-200%)% = +600 false | true -204

Many popular Android calculators, such as Google Calculator and Photomath, also had a problem that I reported to them and they fixed.

@mb-real mb-real closed this as completed Jul 12, 2021
@mb-real mb-real reopened this Jul 12, 2021
@derei
Copy link

derei commented Jul 20, 2024

@mb-real I believe this is open to interpretation:

  • if the % number is considered as a standalone factor, then 200% = 2 (numeric).
  • however, if the % is considered contextually, then 200% in the context of 200 (numeric) is 400 (numeric).

I did some tests and this is the conclusion: this calculator app evaluates any % number contextually in relation to the immediate member to its left.
Example:
60 + 50 * 10% = 65
10% is evaluated in relationship with the value 50, and it represents 10% of 50 (= 5). Hence, 60+5=65.

Whilst this way of % evaluation may piss some puritans, I believe it is much more intuitive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants