HP-9G programming bug
#1

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?

#2

Hi,

did you try other variable names?

Did you try with discrete operations,

like N=N-1 instead of '(--N)' ?

What does the doc say about that 'GOTO 0' construct ?

Or about the error message?

A nesting error indicates that either calling the

subprogram would exceed the the allowed nesting depth,

or maybe you forgot the correct return statement.

Raymond

#3

I have tried N=N-1 or other variables too. The "NEST Er" is discribed in the manual for the GOSUB statement with a maximum of 3 nesting depth.

Another example:

N=0
Lbl 0:
IF(1)THEN{N=N+1}
GOTO 0


N=0
Lbl0:
IF(1)THEN{N=N+1;GOTO 0}

The first example works but the second gives a "NEST Er".



Possibly Related Threads…
Thread Author Replies Views Last Post
  HP Prime graphing bug BruceH 1 1,457 11-19-2013, 08:14 AM
Last Post: Joe Horn
  HP Prime - another cosmetic bug BruceH 3 1,678 11-12-2013, 02:18 PM
Last Post: Ken Shaw
  HP Prime Bug bluesun08 19 5,288 10-14-2013, 10:48 PM
Last Post: Han
  Dedicated HP calculator programming-hardware-bug website? Geoff Quickfall 12 2,703 10-12-2013, 11:34 PM
Last Post: Les Koller
  HP Prime bug in EDITMAT Han 7 2,547 09-27-2013, 10:15 AM
Last Post: Han
  [HP 39Gii] - Bug report Jean-Michel 1 1,589 08-28-2013, 10:53 AM
Last Post: Tim Wessman
  Is the HP-35S bug free? Matt Agajanian 22 6,197 07-01-2013, 04:03 PM
Last Post: Andrés C. Rodríguez (Argentina)
  Has anyone reported this bug to HP? Allen L. 4 1,613 01-10-2013, 07:41 PM
Last Post: Manolo Sobrino
  WP-34s: Strange programming/stack BUG W. Bruce Maguire II 14 3,391 04-30-2012, 06:00 PM
Last Post: W. Bruce Maguire II
  HP-15C Bug with MATRIX 5 Thomas Klemm 17 4,833 02-04-2012, 05:07 PM
Last Post: Paul Dale

Forum Jump: