Return ``x`` reduced modulo ``y``.

    Returns the value of x - n * y, where n is the integer quotient of x
    divided by y, rounded toward zero.

    Special values are handled as described in Section F.9.7.1 of the ISO C99
    standard: If x is infinite or y is zero, the result is NaN. If y is
    infinite and x is finite, the result is x rounded to the current context.
    If the result is zero, it has the sign of x.

def fmod(x, y, context=None):
    """
    Return ``x`` reduced modulo ``y``.

    Returns the value of x - n * y, where n is the integer quotient of x
    divided by y, rounded toward zero.

    Special values are handled as described in Section F.9.7.1 of the ISO C99
    standard: If x is infinite or y is zero, the result is NaN. If y is
    infinite and x is finite, the result is x rounded to the current context.
    If the result is zero, it has the sign of x.

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