Respond to this message
Return to Index
Good example using parenthesis, Ted.
Posted Oct 21, 2010 4:24 PM
In the first example, the operations follow the old rule of: "Multiply and divide before add and subtract".
In the second example, by using parenthesis you can change the order with which operations are performed.
In either case, parsing the input string into it's components, can get rather tricky. You also have to be able to detect many possible input errors including unmatched sets of parentheses.
Also send responses to my email address
Copyright © 1999-2014
. All rights reserved.