def ret_earnings(bre, net_income, dividend):
    """
    Computes ending retained earnings.

    Parameters
    ----------
    bre : int or float
        Beginning retained earnings (at the beginning of the period)
    net_income : int or float
        Net income
    dividend : int or float
        Dividend payment to shareholders

    Returns
    -------
    out : int or float
        Ending retained earnings (at the end of the period)
    """
    return (bre + net_income) - dividend