serso / android-calculatorpp

Android Calculator
421 stars 201 forks source link

Bug in Percent Operator #208

Open mb-real opened 3 years ago

mb-real commented 3 years ago

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.

derei commented 1 month ago

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

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.