-
-
Notifications
You must be signed in to change notification settings - Fork 47
Preserve operation order #7
Copy link
Copy link
Open
Labels
acceptedFeature or bug accepted. PR is welcome.Feature or bug accepted. PR is welcome.feature requestIssue is about a new feature or improving existing feature/behavior.Issue is about a new feature or improving existing feature/behavior.
Metadata
Metadata
Assignees
Labels
acceptedFeature or bug accepted. PR is welcome.Feature or bug accepted. PR is welcome.feature requestIssue is about a new feature or improving existing feature/behavior.Issue is about a new feature or improving existing feature/behavior.
Checklist
Is your feature request related to a problem? Please describe.
Calculator currently does operations in a sequence, what can be a bit misleading, because all system calculators on Android I've seen were preserving operations order.
Describe the solution you'd like
Instead of current way of input, which works like traditional digital calculators, it should rather work like stock Android calculators. It should allow to input the whole equation and then compute it, preserving operation order. Also, while doing this, we should add support for parentheses, so user can override the default operation order.
Describe alternatives you've considered
In SMT Tibor wanted this feature to be only in scientific calculator mode (to be done maybe someday). However, I don't think it's a good idea, since stock calculators have this in every mode, not just scientific.
Additional context
Currently implementing it will be fairly easy, because Calculator is built on
exp4jEvalEx library which preserves operation order.However, if we change the number data type (issue #6), it will need to be done differently. But doing it from the scratch shouldn't be very hard, it's just implementing the simple algorithms like Shunting Yard.