def rule_of_72(interest_rate: float, accurate: bool = False) -> float:
    """
    Calculate the time it will take for money to double based on a given
    interest rate:

    Years to double = 72 / Interest Rate

    Args:
        interest_rate: float written with the decimal moved two
        places to the left, e.g. 7 for 7%

        accurate: Boolean, when set to True the more accurate
        69.3 is used instead of 72.

    Returns:
        The number of years it will take for money to double based
        on an interest rate.
    """
    if interest_rate == 0:
        return float('inf')

    if accurate:
        return 69.3 / interest_rate
    return 72. / interest_rate