Return the remainder of x divided by y, with sign matching that of y.

def mod(x, y, context=None):
    """
    Return the remainder of x divided by y, with sign matching that of y.

    """
    return _apply_function_in_current_context(
        BigFloat,
        mpfr_mod,
        (
            BigFloat._implicit_convert(x),
            BigFloat._implicit_convert(y),
        ),
        context,
    )