def frac(x, context=None):
    """
    Return the fractional part of ``x``.

    The result has the same sign as ``x``.

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