def factorial(n):
    """ Naive computation of factorial(n) with products. Not recursive."""
    if n <= 0: return 1.0
    else:
        f = 1.0
        for i in range(2, n+1):
            f *= i
        return float(f)