def double_factorial(k: int) -> int:
    """
    Returns the double factorial of the number, the product of all positive integers of the same parity smaller or
    equal to the number.
    By convention an empty product is considered 1, meaning double_factorial(0) will return 1.

    :param k: A positive integer
    :return: The double factorial of that integer
    """
    result = 1
    for i in range(1 if k % 2 == 1 else 2, k + 1, 2):
        result *= i
    return result