The Museum of HP Calculators

HP Forum Archive 06

[ Return to Index | Top of Index ]

Question about RPL equality tests
Message #1 Posted by Chris Randle (Lincoln, UK) on 13 Oct 2001, 10:47 p.m.

I've read the HP-28S manual's bit where it explains the difference between = = and SAME, but I don't quite get it. Could some kind soul explain in simpler terms how they differ? Perhaps some rule of thumb such as "always use such-and-such unless this or that"? Thanks in advance.

      
Re: Question about RPL equality tests
Message #2 Posted by Vieira, Luiz C. (Brazil) on 14 Oct 2001, 9:17 p.m.,
in response to message #1 by Chris Randle (Lincoln, UK)

O.K., let's do it: think of 2 'X' STO and 3 'Y' STO. The sequence

'X+Y' 5 SAME returns 0 (false) and 'X+Y' 5 == EVAL returns 1 (true).

The rule is == always evaluate both arguments, and SAME doesn't. Also, SAME is a command and cannot be used in an algebraic (e.g. 'SAME(X,Y)' or 'X SAME Y' don't exist) but == can, as it is a function.

There are some other diferences when using == applied to other types of objects. By now, does it clear? If not, post another question.

Best regards.

            
Re: Question about RPL equality tests
Message #3 Posted by Chris Randle (Lincoln, UK) on 15 Oct 2001, 4:38 a.m.,
in response to message #2 by Vieira, Luiz C. (Brazil)

Clear and understood. Thanks.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall