math - Calculations in a sequential manner? -


I am creating a calculator in javascript. I have two means for the development of the operation. Use the first instrument eval method The second method that I have not completed, must be executed in sequential mode.

Example:

3-5x3 / 2

The code should not be executed before multiplying, but the result should be calculated sequentially, That is:

3-5 = -2 * 3 = -6 / 2 = -3

How can I do this?

I'm not sure how you implement it, but you have to bracket around each operation ) This way it can be sequential.

Comments

Popular posts from this blog

python - how we can use ajax() in views.py in django? -

matlab - Using loops to get multiple values into a cell -

python - Sequence Pattern recognition with Pybrain -