Eu 2.3 trace BUG!
- Posted by akusaya at gmx.net Apr 11, 2002
- 341 views
This is my code: ------------------ start ------------ function cekPrima(sequence bilPrima, atom cekangka) atom isilist for j=1 to length(bilPrima) do isilist=bilPrima[j] if (cekangka/isilist - floor(cekangka/isilist))=0 then --bukan bil prima return 0 else --bilprima if power(isilist,2)>cekangka then return 1 end if end if end for return 1 end function sequence p p = {2, 3} for i = 3 to 10000 by 2 do if cekPrima(p, i)=1 then p &= i end if end for ? p integer pos integer jum with trace trace(1) for i=2 to 100000000 do pos = 1 jum = 1 while 1 do if p[pos] > sqrt(i) then exit elsif p[pos] = sqrt(i) then jum += p[pos] else pos += 1 if integer( i/p[pos] ) then jum += i/p[pos] + p[pos] end if end if end while if jum = i then ? i end if end for ------------------------- end ---------------- Execute, and it will bring a trace window. Highlighted: for i=2 to 100000000 do Press DOWN. (don't press ENTER) Press ?i "i=9999" is displayed on left side??? it should be 2. Press ENTER many times until "end for" Press ENTER one time more. "i=9999" in the left disappears, "i=3" appears in right side. Press ?i "i=3" in the right disappears, "i=9999" appears again in left side. Is this really a bug?!