Re: HP48 program improvement. . . Message #3 Posted by Joe Panico on 23 Jan 2002, 12:37 p.m., in response to message #1 by Tal
Tal,
Assuming the local variables i and j are set elsewhere, the following code works. The original code has no default value or action if an i & j pair is not found, or if neither value is not within the tested values.
{ 7 8 9 10 11 12 }
{ 6 12 17 56 34 37 } j POS
{ 1 23 45 67 89 111 } i POS
OVER == OVER 0 /= AND
IF
THEN GET
ELSE DROP@
END
This simplifies the code, I'm not sure about the speed. The =/ above is the HP48 not equal test.
Joe
|