def kcorrect_calc(
    d: float, oldflux: float, z1: float, z2: float, a: float
) -> float:
    """Performs the k-correction calculation given the required arguments.

    Args:
        d: The distance modulation, in terms of a factor. E.g. a value of 10
            would indicate a distance change of 10x.
        oldflux: The current flux of the source (radio or optical).
        z1: The current redshift.
        z2: The new redshift.
        a: The alpha value to use in the calculation.

    Returns:
        The k-corrected new flux.
    """
    return oldflux * ((1. / d) * (1. / d)) * ((1 + z1) / (1 + z2))**(-(a) - 1)