You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
App relies on exp4j to perform calculations, which is based on Double data type. It's a floating-point data type, which causes accuracy loss, especially with very long inputs.
I see two possible solutions:
Stop relying on exp4j for calculations (especially that app doesn't utilize its most powerful feature - preserving operation order) and rewrite the app to use BigDecimal instead Double.
Add validation to input, which would stop users from inputting numbers too large to be handled by Double type. However, it won't guarantee that user won't run in the same problem during calculations.
To Reproduce
Steps to reproduce the behavior:
Open the app.
Tap any digit (despite 0) circa 20 times.
Result: At some point, instead of the digit I input, 0 is added.
Another case:
Open the app.
Tap decimal separator and then 9 over 13 times.
Result: At some point, the integer part of the number starts incrementing by one with each new decimal digit.
Expected behavior
I should see the number I've typed.
Device info (please complete the following information):
Model: OnePlus 9 Pro
OS: Android 13
Version Simple Calculator 5.12.0
The text was updated successfully, but these errors were encountered:
Checklist
Describe the bug
App relies on exp4j to perform calculations, which is based on
Double
data type. It's a floating-point data type, which causes accuracy loss, especially with very long inputs.I see two possible solutions:
BigDecimal
insteadDouble
.Double
type. However, it won't guarantee that user won't run in the same problem during calculations.To Reproduce
Steps to reproduce the behavior:
Result: At some point, instead of the digit I input,
0
is added.Another case:
9
over 13 times.Result: At some point, the integer part of the number starts incrementing by one with each new decimal digit.
Expected behavior
I should see the number I've typed.
Device info (please complete the following information):
The text was updated successfully, but these errors were encountered: