Home | History | Annotate | Download | only in python2.7

Lines Matching defs:shift

1330             shift = len(other._int) - len(self._int) + context.prec + 1
1331 exp = self._exp - other._exp - shift
1334 if shift >= 0:
1335 coeff, remainder = divmod(op1.int * 10**shift, op2.int)
1337 coeff, remainder = divmod(op1.int, op2.int * 10**-shift)
2670 shift = prec-l
2671 if shift >= 0:
2672 c *= 100**shift
2675 c, remainder = divmod(c, 100**-shift)
2677 e -= shift
2691 if shift >= 0:
2692 # assert n % 10**shift == 0
2693 n //= 10**shift
2695 n *= 10**-shift
2696 e += shift
3590 def shift(self, other, context=None):
3618 # let's shift!
5255 def shift(self, a, b):
5260 to shift is taken from the absolute value of the second operand,
5261 with the shift being to the left if the second operand is
5265 >>> ExtendedContext.shift(Decimal('34'), Decimal('8'))
5267 >>> ExtendedContext.shift(Decimal('12'), Decimal('9'))
5269 >>> ExtendedContext.shift(Decimal('123456789'), Decimal('-2'))
5271 >>> ExtendedContext.shift(Decimal('123456789'), Decimal('0'))
5273 >>> ExtendedContext.shift(Decimal('123456789'), Decimal('+2'))
5275 >>> ExtendedContext.shift(88888888, 2)
5277 >>> ExtendedContext.shift(Decimal(88888888), 2)
5279 >>> ExtendedContext.shift(88888888, Decimal(2))
5283 return a.shift(b, context=self)
5530 def _rshift_nearest(x, shift):
5531 """Given an integer x and a nonnegative integer shift, return closest
5532 integer to x / 2**shift; use round-to-even in case of a tie.
5535 b, q = 1L << shift, x >> shift
5769 shift = e+q
5770 if shift >= 0:
5771 cshift = c*10**shift
5773 cshift = c//10**-shift
5804 shift = ye-b
5805 if shift >= 0:
5806 pc = lxc*yc*10**shift
5808 pc = _div_nearest(lxc*yc, 10**-shift)