// Loop variables used in tests
var i,j as int;
var p,q as polyn;
p = 6x^6+5x^5-4x^4-3x^3+2x^2+x+10;
// Test stop in single loops
for i from 1 to 10 do
if (i == 8) then stop i; fi;
print(i); print(" ");
od;
println("");
foreach q in p do
if degree(q) == 3 then stop q; fi;
print(q," ");
od;
println("");
// Test stop in nested loops
for i from 1 to 100 do
for j from 2 to 10 do
if (j^4 == i) then stop i;
fi;
od;
od;
println("The first number with a fourth root after 1 is: ",i);
foreach q in p do
for i from 1 to 100 do
if (q/(x^i)) isa int then
println("The degree of ",q," is ",i);
stop i;
fi;
od;
od;