CHAT: Stack Operations/RPN (was: Results of Poll by Email No. 27)
|From:||Iain E. Davis <feaelin@...>|
|Date:||Monday, April 7, 2003, 22:59|
> From: Robert B Wilson
> On Mon, 7 Apr 2003 12:32:20 -0400 John Cowan
> > Joe scripsit:
> > > But when working with a stack, the computer will naturally take
> > the last
> > > value first, will it not?
> > Yes, but it still pushes the left-hand argument on the
> stack first; on
> > an RPN calculator you calculate 2 - 3 by saying "2 <enter> 3 -".
> hmm... that's odd... quite illogical, IMO...
It's useful for some things. It depends on what you're working with.
Adding up columns of numbers (or perhaps adding numbers that are being
given verbally) it can be very handy, since you enter a sequence like this:
56 48 67 34 24 74 and then hit "+" until you only have one value left on the
stack (the total). Same number of "keypresses", but not having to press +
in between the numbers can speed things up. I use both a RPN calculator and
the other kind (standard?) on my palm, depending on what I'm actually doing.