This isn't a bug, I think. After the first while loop, r has the value
256.
Since rmax is 200, the second while loop never executes the body of the
loop.
Try re-assigning r to 2 before the second while loop---I think you'll see
that
all is well.
Barton
maxima-bounces at math.utexas.edu wrote on 05/12/2009 11:07:01 AM:
> Here are 2 examples of using while in Maxima :
>
> --------- first ------------------
> (%i6) r:2;
> (%o6) 2
> (%i7) while r<200 do disp(r:r*r);
> 4
> 16
> 256
> (%o7) done
> ------------second -----------------
> (%i8) rmax:200;
> (%o8) 200
> (%i9) while r<rmax do disp(r:r*r);
> (%o9) done
> ---------- end------------------
>
> First works, second not.
> Is it something wrong with this second example ?
>