Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Excuse me for the newbish question in advance but how should I make sure I don't make a mistake converting from RPN to infix notation when I don't know if some of the numbers aren't two-digit ones or when I do that some are but I don't know which ones? For example, how do I know if I should evaluate $112+$ to $11+2$ or $1+12$? Or such thing is impossible to evaluate when I don't know where the enters were put in?

share|cite|improve this question
up vote 3 down vote accepted

You have to know where the breaks are (where the user pressed enter). In RPN, you put one number on the stack, put a second number in the next spot on the stack, and then do an operation on those two numbers. If you don't know the contents of each position in the stack (i.e., you don't know if 112 is 11 in one position and 2 in the other or 1 in one position and 12 in the other) then you can't evaluate it.

share|cite|improve this answer
OK, thank you :) – George Shack Dec 5 '12 at 19:20

HP RPN calculators had (have?) an ENTER key for that reason. See this image.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.