[OT] -10^2
Jan Schenkel
janschenkel at yahoo.com
Sat May 24 15:19:00 EDT 2003
--- Geoff Canyon <gcanyon at inspiredlogic.com> wrote:
>
> On Friday, May 23, 2003, at 07:50 AM, Jan Schenkel
> wrote:
>
> > --- Geoff Canyon <gcanyon at inspiredlogic.com>
> wrote:
> >>
> >> I was assuming there were other values on the
> stack beneath the given
> >> expression. In other words how would you make the
> - negate the 10^2
> >> portion of this instead of subtracting 5 from it?
> >>
> >> 5 10 2 ^ - *
> >>
> >> What I want is this:
> >>
> >> (-(10^2))*5
> >
> > In this case, you would have to put the 5 between
> the
> > minus and the multiply
> >
> > 10 2 ^ - 5 *
> >
> > Or you could sneak in a zero and make the minus a
> > binary operator :
> >
> > 5 0 10 2 ^ - *
>
> So even with RPN it's possible to have ambiguity. Is
> it possible to use
> parenthesis to resolve it, or do you have to use the
> tricks listed
> above?
>
> regards,
>
> Geoff Canyon
>
Hi Geoff,
I wouldn't call that ambiguity at all : the rules are
clear ; you just have more than one way of describing
the same expression -- like any other method. And
that's a good thing too, as some thinking and juggling
with expressions allows us to optimise, right ?
In this case, as David was kind enough to point out,
most RPN calculators have a separate button for the
unary minus. Now where did I put those batteries ; I
wanna fire up my HP42s, for old times' sake :-)
Best regards,
Jan Schenkel.
=====
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
More information about the use-livecode
mailing list