Order of Algebraic Operations

Back to Dave's Resume

When you were in algebra, you learned that expressions had to be evaluated in a certain order. For example, you knew that multiplication had to be done before addition in an expression like this:

3 + 4 * 5

I have written a JavaScript routine that takes an expression that you type and shows you the order in which the operations are performed.

Try it out! Please let me know what you think of it. Bug fixes and suggestions for improvements are always welcome.


NOTE: This example requires Netscape 2.0 or a browser that interprets JavaScript.

In case you were wondering, the rules for order of operations are: