[Tutor] Simple RPN calculator
Kent Johnson
kent37 at tds.net
Sun Dec 5 12:55:19 CET 2004
RPN reverses the order of operator and operand, it doesn't reverse the whole string. So in Polish
Notation 2 + 3 is +23 and (2 + 3) - 1 is -+231; in RPN they become 23+ and 23+1-
Kent
Brian van den Broek wrote:
> By analogy, I had always assumed that Polish Arithmetic would read
>
> (2 + 3) - 1 and
> 2 + (3 - 1)
>
> as:
>
> -+231 and
> +2-31
>
> I further assumed that RPN would simply reverse this. If that isn't
> true, I think I need to go investigate the origins of the name.
>
> Best to all,
>
> Brian vdB
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
More information about the Tutor
mailing list