fun factorial(n)= let fun fac_it(m,f,c)= if (c=m) then f else fac_it(m,f*(c+1),c+1); in fac_it(n,1,0) end;