コード例 #1
0
def _pow_ovf2long(space, iv, iw, w_modulus):
    if space.is_none(w_modulus) and _recover_with_smalllong(space):
        from pypy.objspace.std.smalllongobject import _pow as _pow_small
        try:
            # XXX: shouldn't have to pass r_longlong(0) here (see
            # 4fa4c6b93a84)
            return _pow_small(space, r_longlong(iv), iw, r_longlong(0))
        except (OverflowError, ValueError):
            pass
    from pypy.objspace.std.longobject import W_LongObject
    w_iv = W_LongObject.fromint(space, iv)
    w_iw = W_LongObject.fromint(space, iw)
    return w_iv.descr_pow(space, w_iw, w_modulus)
コード例 #2
0
ファイル: intobject.py プロジェクト: timfel/thesis-data
def _pow_ovf2long(space, iv, iw, w_modulus):
    if space.is_none(w_modulus) and _recover_with_smalllong(space):
        from pypy.objspace.std.smalllongobject import _pow as _pow_small
        try:
            # XXX: shouldn't have to pass r_longlong(0) here (see
            # 4fa4c6b93a84)
            return _pow_small(space, r_longlong(iv), iw, r_longlong(0))
        except (OverflowError, ValueError):
            pass
    from pypy.objspace.std.longobject import W_LongObject
    w_iv = W_LongObject.fromint(space, iv)
    w_iw = W_LongObject.fromint(space, iw)
    return w_iv.descr_pow(space, w_iw, w_modulus)