HP-9G programming bug Message #1 Posted by Xerxes on 28 May 2007, 9:54 a.m.
I tried to program the N-Queens Problem on the HP-9G for benchmarking and get a "NEST Er" without a plausible reason. After invastigating the problem, I have found the following:
N=3
S=0
Lbl 0:
S=S+N
IF(--N)THEN{GOTO 0}
PRINT S
This simple program for the sum of 1..n works only to N=3. The reason seems to be the jump out of the IF block more than 3 times.
Is it possible to avoid this problem?
|