Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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|improve this question
add comment

2 Answers 2

up vote 2 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|improve this answer
    
OK, thank you :) –  George Shack Dec 5 '12 at 19:20
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

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.