The Museum of HP Calculators

HP Forum Archive 16

[ Return to Index | Top of Index ]

Optimization and Error !!!
Message #1 Posted by gileno on 5 Nov 2006, 8:29 a.m.

1 5
2 x<=Y?
3 GTO 01
4 RDN
5 5
6 X>Y?
7 GTO 02
8 RDN
9 -5
10 X<=y?
11 GTO 03
12 RND
13 -5
14 X>Y?
15 '--
16 LBL 04
17 PROMPT
18 Sequence of instructions ....

30 LBL 01 31 '+ 32 GOTO 04 33 LBL 02 34 '++ 35 GTO 04 36 LBL 03 37 '- 28 GTO 04

-2 R/S + ????

How would I do to show '-' ?

Thank you

      
Re: Optimization and Error !!!
Message #2 Posted by Kiyoshi Akima on 5 Nov 2006, 1:49 p.m.,
in response to message #1 by gileno

You're getting + because -2 is less than 5.

Just what are you trying to do? Determine which of the four ranges [-infinity, -5], (-5, 0), [0, 5), [5, infinity] the number is in?


[ Return to Index | Top of Index ]

Go back to the main exhibit hall