Hi, again.
Now I have a question about Incompatible Types message. I know what it means but idk why it appears in a program I have integers ONLY. Take a look please and explain me where the number becomes Extended and why? Thanks a lot.
Code
(It may have more errors):
var
ta,l,p,i,j,d2ta,d3ta,d2l,d3l,d2f,d3f,nf,nta,nl:integer;
f,g:text;
begin
assign(f,'daruri.in');
reset(f);
read(f,ta);
readln(f,l);
close(f);
if frac(ta/2)=0 then inc(d2ta)
else if frac(ta/3)=0 then inc(d3ta)
else for i:=4 to 32000 do
if frac(ta/i)<>0 then continue
else break;
if frac(l/2)=0 then inc(d2l)
else if frac(l/3)=0 then inc(d3l)
else for j:=4 to 32000 do
if frac(l/j)<>0 then continue
else break;
if d2ta<=d2l then if d2ta=0 then d2f:=1 else d2ta:=d2f
else d2l:=d2f;
if d3ta<=d3l then if d3ta=0 then d3f:=1 else d3ta:=d3f
else d3l:=d3f;
if i<=j then i:=nf
else j:=nf;
p:=d2f*d3f*nf;
nta:=ta/p;
nl:=l/p;
assign(g,'daruri.out');
rewrite(g);
writeln(g,p);
write(g,nta);
write(g,nl);
close(g);
end.
Error message:s(27,8)Error: Incompatible types: got "Extended" expected "SmallInt"
s(28,6)Error: Incompatible types: got "Extended" expected "SmallInt"
s(41)Fatal: There were 2 errors compiling module, stopping
s(0)Fatal: Compilation aborted
Thanks again, nice community. HaVe A nIcE dAy