function y=fac(i)
% FAC(i) factorial of integer i

if i>0,
y=i;
for k=1:i-1
y=y*(i-k);
end
else
    y=1;
end



