I've wrote a parser in PHP that converts a string representation of an equation to RPN based on feedback from an earlier question. Whilst testing it I found two different equations that parse to the same thing in RPN. Because they end up as the same thing in RPN when you solve them you get the same answer.
- 3 + 4 * 8 / (1 -5)
- 3 + 4 * 8 / 1 -5
Both end up as 348*15-/+ which when solved gives an answer of -5 which is correct for the first one, but the answer to the second one should be 30.
So have I misunderstood how to convert to RPN? The code to my parser can be found in the above link to the previous question.