HP-9G programming bug « Next Oldest | Next Newest »

 ▼ Xerxes Member Posts: 136 Threads: 7 Joined: Jun 2007 05-28-2007, 09:54 AM 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? ▼ Raymond Del Tondo Posting Freak Posts: 1,841 Threads: 54 Joined: Jul 2005 05-28-2007, 11:12 AM 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 ▼ Xerxes Member Posts: 136 Threads: 7 Joined: Jun 2007 05-28-2007, 11:43 AM 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 891 11-19-2013, 08:14 AM Last Post: Joe Horn HP Prime - another cosmetic bug BruceH 3 1,215 11-12-2013, 02:18 PM Last Post: Ken Shaw HP Prime Bug bluesun08 19 3,627 10-14-2013, 10:48 PM Last Post: Han Dedicated HP calculator programming-hardware-bug website? Geoff Quickfall 12 1,854 10-12-2013, 11:34 PM Last Post: Les Koller HP Prime bug in EDITMAT Han 7 1,890 09-27-2013, 10:15 AM Last Post: Han [HP 39Gii] - Bug report Jean-Michel 1 1,009 08-28-2013, 10:53 AM Last Post: Tim Wessman Is the HP-35S bug free? Matt Agajanian 22 4,305 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,115 01-10-2013, 07:41 PM Last Post: Manolo Sobrino WP-34s: Strange programming/stack BUG W. Bruce Maguire II 14 2,473 04-30-2012, 06:00 PM Last Post: W. Bruce Maguire II HP-15C Bug with MATRIX 5 Thomas Klemm 17 3,447 02-04-2012, 05:07 PM Last Post: Paul Dale

Forum Jump: