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

Feature: run all calcs at once, support order of operations #10

Open
thereisnodeveloper opened this issue Aug 6, 2023 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@thereisnodeveloper
Copy link
Owner

No description provided.

@thereisnodeveloper thereisnodeveloper added the enhancement New feature or request label Aug 6, 2023
@thereisnodeveloper
Copy link
Owner Author

use objects inside array, each object stores 1) an operator and 2) series of numbers to run calculations on

@thereisnodeveloper
Copy link
Owner Author

order of operations -
multiplications
left to right

addition/subtraction
left to right

EXAMPLE:
3 x 15 + 14 / 2 x 3
Arrays:
3, 15, 14, 2, 3
x + / x
x for [0] [1] and [3] [4]

  • for [1] [2]
    / for [2] [3]

REARRANGE based on operators
x 01 34
/ 23

  • 12

(run calculation, then store it in the last place of the temporary array [[0],[1]]

x 01 --> [empty] [empty] [45] + 14 / 2

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

No branches or pull requests

1 participant