In [1]:
function fac(start, n)
  for k = 2:n
    start = start*k
  end
  return start
end


Out[1]:
fac (generic function with 1 method)

In [2]:
println("Result of n = 1 is: ", fac(1, 30))
println("Result of n = BigInt(1) is: ", fac(BigInt(1), 30))
println("Result of n = 1.0 is: ", fac(1.0, 30))


Result of n = 1 is: -8764578968847253504
Result of n = BigInt(1) is: 265252859812191058636308480000000
Result of n = 1.0 is: 2.6525285981219103e32

In [ ]: