Stumped by infinite loop in Maxima 5.13.0 (using wxMaxima 0.7.3a)
Subject: Stumped by infinite loop in Maxima 5.13.0 (using wxMaxima 0.7.3a)
From: George Leeman
Date: Thu, 6 Dec 2007 17:14:45 -0500
If I define the function
nonzerosines(m):=
block([h,i,j,s],
s:[],h:2*m-1,
for i:1 thru h do
s:cons(makelist(0,j,1,m),s),
for i:1 thru h do
if sin(i*%pi/2)#0 then do s[i][1]:sin(i*%pi/2),
return(s));
then running 'nonzerosines(1)' produces an infinite loop. If the function
is put into the file 'test.mac,' then in the Maxima debugger after the
commands
batchload("f:/maxima/test.mac");
:br nonzerosines 6;
nonzerosines(1);
h;
i;
s;
the expected values are displayed for h, i, and s, but then ':n' causes the
loop in the 'if...' line. Anybody see why?
-- George Leeman