def error_in_flux(e_magnitude, flux):
    """Calculate the error from flux from the error in magnitude.

    Parameters
    ----------
    e_magnitude: float
        The error in the magnitude calculation.
    flux: float
        The value of the flux.

    Returns
    -------
    error: float
        The error in the flux conversion.
    """
    error_upper = flux * (10**(0.4 * e_magnitude) - 1.0)
    error_lower = flux * (1 - 10**(-0.4 * e_magnitude))
    error = 0.5 * (error_lower + error_upper)

    return error