Speaking of which, what operators must the thing support, and what are the precedence rules it must follow?
Printable View
Speaking of which, what operators must the thing support, and what are the precedence rules it must follow?
Hello,
The standard operators are +, -, *, /, !, and ^; where ^ represents the exponential operator, and ! represents factorial.
The link I provided earlier has a figure that shows Operator Precedence in descending order. Also, in an infix expression, the operators do not appear (from left to right) in the order in which they are to be carried out. Instead, we use parentheses and precedence rules to indicate the order in which they should be done. In the absence of parentheses, the following precedence rules are in effect:
- Exponentiation has the highest precedence. Perform exponentiations in order first, from left to right.
- Multiplication and division have the next-highest precedence. After performing all exponentiations, perform multiplications and divisions in order, from left to right.
- Addition and subtraction have the lowest precedence. After performing all multiplications and divisions, perform additions and subtractions in order, from left to right.
In actuality, exponentiation is right-associative, but we'll keep things simple.
- Stack Overflow
My solution was emailed to you. I view it as a no-nonsense response. Thanks for the challenge.
Hello,
Submission received. Thanks for participating. :cool:
- Stack Overflow
Did you recieve my submission as well?
I submitted the old code, I wasn't even able to make it compile on VC++.NET.
Hello,
Well, I just checked my eMail this morning, and I did receive it. Heh, it's getting close to the deadline; it's time I grade all of the submissions. I'm about to look over the eMail.
Thanks for participating :cool:
- Stack Overflow