this program gives an error on line 20; also, it doesn't follow line by line while walking through the if then else portion. can someone help me? my e-mail is leavemsg1(at)gmail.com; I'm not sure if I will be able to find my way back to this forum. thanks in advance with any/all help; this program works very well in qbasic, but I need to use ubasic. thanks.
10 CLS
12 INPUT N
14 IF SQRT(N) = INT(SQRT(N)) THEN
16 PRINT SQRT(N)
18 ELSE
20 D = .576129365#: E = 2 * INT(LOG(N)/LOG(10))
22 M1 = N ^ D
24 M2 = M1 ^ EXP(1)
26 FOR I = 1 TO E
28 M3 = INT(D * I * M2)
30 FOR J = -E TO E
32 Z1 = N: Z2 = M3 + J: Z3 = 1
34 IF Z1 > Z2 THEN TMP = Z1: Z1 = Z2: Z2 = TMP
36 WHILE (Z3 <> 0)
38 Z3 = Z1 MOD Z2: Z1 = Z2: Z2 = Z3
40 WEND
42 IF Z1 > 1 AND Z1 < N THEN
44 PRINT Z1: I = E: J = E
46 END IF
48 NEXT J
50 NEXT I
52 END IF
54 GOTO 12
Bill ~~~~