The implementation of factorial in Base is
function factorial(n::Integer) n < 0 && throw(DomainError(n, "`n` must be nonnegative.")) f::typeof(n*n) = 1 for i::typeof(n*n) = 2:n f *= i end return f end
Why typeof(n*n) instead of typeof(n)? This maybe a dumb question but I really don’t get it.