Lines Matching refs:ob_digit
31 Py_SIZE(x) < 0 ? -(sdigit)(x)->ob_digit[0] : \
33 (sdigit)(x)->ob_digit[0]))
106 while (i > 0 && v->ob_digit[i-1] == 0) in long_normalize()
118 ((PY_SSIZE_T_MAX - offsetof(PyLongObject, ob_digit))/sizeof(digit))
134 result = PyObject_Malloc(offsetof(PyLongObject, ob_digit) + in _PyLong_New()
164 result->ob_digit[i] = src->ob_digit[i]; in _PyLong_Copy()
201 v->ob_digit[0] = Py_SAFE_DOWNCAST( in PyLong_FromLong()
213 v->ob_digit[0] = Py_SAFE_DOWNCAST( in PyLong_FromLong()
215 v->ob_digit[1] = Py_SAFE_DOWNCAST( in PyLong_FromLong()
230 digit *p = v->ob_digit; in PyLong_FromLong()
258 digit *p = v->ob_digit; \
337 v->ob_digit[i] = bits; in PyLong_FromDouble()
401 res = -(sdigit)v->ob_digit[0]; in PyLong_AsLongAndOverflow()
407 res = v->ob_digit[0]; in PyLong_AsLongAndOverflow()
418 x = (x << PyLong_SHIFT) | v->ob_digit[i]; in PyLong_AsLongAndOverflow()
502 case -1: return -(sdigit)v->ob_digit[0]; in PyLong_AsSsize_t()
504 case 1: return v->ob_digit[0]; in PyLong_AsSsize_t()
514 x = (x << PyLong_SHIFT) | v->ob_digit[i]; in PyLong_AsSsize_t()
564 case 1: return v->ob_digit[0]; in PyLong_AsUnsignedLong()
568 x = (x << PyLong_SHIFT) | v->ob_digit[i]; in PyLong_AsUnsignedLong()
608 case 1: return v->ob_digit[0]; in PyLong_AsSize_t()
612 x = (x << PyLong_SHIFT) | v->ob_digit[i]; in PyLong_AsSize_t()
641 case 1: return v->ob_digit[0]; in _PyLong_AsUnsignedLongMask()
650 x = (x << PyLong_SHIFT) | v->ob_digit[i]; in _PyLong_AsUnsignedLongMask()
708 assert(ndigits == 0 || v->ob_digit[ndigits - 1] != 0); in _PyLong_NumBits()
710 digit msd = v->ob_digit[ndigits - 1]; in _PyLong_NumBits()
819 v->ob_digit[idigit] = (digit)(accum & PyLong_MASK); in _PyLong_FromByteArray()
829 v->ob_digit[idigit] = (digit)accum; in _PyLong_FromByteArray()
882 assert(ndigits == 0 || v->ob_digit[ndigits - 1] != 0); in _PyLong_AsByteArray()
888 digit thisdigit = v->ob_digit[i]; in _PyLong_AsByteArray()
1061 digit *p = v->ob_digit; in PyLong_FromLongLong()
1104 digit *p = v->ob_digit; in PyLong_FromSsize_t()
1144 bytes = -(sdigit)v->ob_digit[0]; in PyLong_AsLongLong()
1150 bytes = v->ob_digit[0]; in PyLong_AsLongLong()
1189 case 1: return v->ob_digit[0]; in PyLong_AsUnsignedLongLong()
1220 case 1: return v->ob_digit[0]; in _PyLong_AsUnsignedLongLongMask()
1230 x = (x << PyLong_SHIFT) | v->ob_digit[i]; in _PyLong_AsUnsignedLongLongMask()
1301 res = -(sdigit)v->ob_digit[0]; in PyLong_AsLongLongAndOverflow()
1307 res = v->ob_digit[0]; in PyLong_AsLongLongAndOverflow()
1318 x = (x << PyLong_SHIFT) + v->ob_digit[i]; in PyLong_AsLongLongAndOverflow()
1573 *prem = inplace_divrem1(z->ob_digit, a->ob_digit, size, n); in divrem1()
1629 pin = a->ob_digit; in long_to_decimal_string_internal()
1630 pout = scratch->ob_digit; in long_to_decimal_string_internal()
1824 bit_length_digit(a->ob_digit[size_a - 1]); in long_format_binary()
1861 accum |= (twodigits)a->ob_digit[i] << accumbits; \ in long_format_binary()
2078 pdigit = z->ob_digit; in long_from_binary_base()
2090 assert(pdigit - z->ob_digit <= n); in long_from_binary_base()
2099 assert(pdigit - z->ob_digit <= n); in long_from_binary_base()
2101 while (pdigit - z->ob_digit < n) in long_from_binary_base()
2385 pz = z->ob_digit; in PyLong_FromString()
2408 memcpy(tmp->ob_digit, in PyLong_FromString()
2409 z->ob_digit, in PyLong_FromString()
2413 z->ob_digit[size_z] = (digit)c; in PyLong_FromString()
2546 a->ob_digit[size_a-1] < b->ob_digit[size_b-1])) { in long_divrem()
2559 z = divrem1(a, b->ob_digit[0], &rem); in long_divrem()
2634 d = PyLong_SHIFT - bit_length_digit(w1->ob_digit[size_w-1]); in x_divrem()
2635 carry = v_lshift(w->ob_digit, w1->ob_digit, size_w, d); in x_divrem()
2637 carry = v_lshift(v->ob_digit, v1->ob_digit, size_v, d); in x_divrem()
2638 if (carry != 0 || v->ob_digit[size_v-1] >= w->ob_digit[size_w-1]) { in x_divrem()
2639 v->ob_digit[size_v] = carry; in x_divrem()
2654 v0 = v->ob_digit; in x_divrem()
2655 w0 = w->ob_digit; in x_divrem()
2658 for (vk = v0+k, ak = a->ob_digit + k; vk-- > v0;) { in x_divrem()
2756 a_bits = bit_length_digit(a->ob_digit[a_size-1]); in _PyLong_Frexp()
2794 rem = v_lshift(x_digits + x_size, a->ob_digit, a_size, in _PyLong_Frexp()
2802 rem = v_rshift(x_digits, a->ob_digit + shift_digits, in _PyLong_Frexp()
2813 if (a->ob_digit[--shift_digits]) { in _PyLong_Frexp()
2893 diff = (sdigit) a->ob_digit[i] - (sdigit) b->ob_digit[i]; in long_compare()
2924 case -1: return v->ob_digit[0]==1 ? -2 : -(sdigit)v->ob_digit[0]; in long_hash()
2926 case 1: return v->ob_digit[0]; in long_hash()
2962 x += v->ob_digit[i]; in long_hash()
2994 carry += a->ob_digit[i] + b->ob_digit[i]; in x_add()
2995 z->ob_digit[i] = carry & PyLong_MASK; in x_add()
2999 carry += a->ob_digit[i]; in x_add()
3000 z->ob_digit[i] = carry & PyLong_MASK; in x_add()
3003 z->ob_digit[i] = carry; in x_add()
3029 while (--i >= 0 && a->ob_digit[i] == b->ob_digit[i]) in x_sub()
3033 if (a->ob_digit[i] < b->ob_digit[i]) { in x_sub()
3045 borrow = a->ob_digit[i] - b->ob_digit[i] - borrow; in x_sub()
3046 z->ob_digit[i] = borrow & PyLong_MASK; in x_sub()
3051 borrow = a->ob_digit[i] - borrow; in x_sub()
3052 z->ob_digit[i] = borrow & PyLong_MASK; in x_sub()
3143 memset(z->ob_digit, 0, Py_SIZE(z) * sizeof(digit)); in x_mul()
3153 twodigits f = a->ob_digit[i]; in x_mul()
3154 digit *pz = z->ob_digit + (i << 1); in x_mul()
3155 digit *pa = a->ob_digit + i + 1; in x_mul()
3156 digit *paend = a->ob_digit + size_a; in x_mul()
3191 twodigits f = a->ob_digit[i]; in x_mul()
3192 digit *pz = z->ob_digit + i; in x_mul()
3193 digit *pb = b->ob_digit; in x_mul()
3194 digit *pbend = b->ob_digit + size_b; in x_mul()
3242 memcpy(lo->ob_digit, n->ob_digit, size_lo * sizeof(digit)); in kmul_split()
3243 memcpy(hi->ob_digit, n->ob_digit + size_lo, size_hi * sizeof(digit)); in kmul_split()
3343 memset(ret->ob_digit, 0xDF, Py_SIZE(ret) * sizeof(digit)); in k_mul()
3350 memcpy(ret->ob_digit + 2*shift, t1->ob_digit, in k_mul()
3356 memset(ret->ob_digit + 2*shift + Py_SIZE(t1), 0, in k_mul()
3366 memcpy(ret->ob_digit, t2->ob_digit, Py_SIZE(t2) * sizeof(digit)); in k_mul()
3371 memset(ret->ob_digit + Py_SIZE(t2), 0, i * sizeof(digit)); in k_mul()
3377 (void)v_isub(ret->ob_digit + shift, i, t2->ob_digit, Py_SIZE(t2)); in k_mul()
3380 (void)v_isub(ret->ob_digit + shift, i, t1->ob_digit, Py_SIZE(t1)); in k_mul()
3410 (void)v_iadd(ret->ob_digit + shift, i, t3->ob_digit, Py_SIZE(t3)); in k_mul()
3493 memset(ret->ob_digit, 0, Py_SIZE(ret) * sizeof(digit)); in k_lopsided_mul()
3506 memcpy(bslice->ob_digit, b->ob_digit + nbdone, in k_lopsided_mul()
3514 (void)v_iadd(ret->ob_digit + nbdone, Py_SIZE(ret) - nbdone, in k_lopsided_mul()
3515 product->ob_digit, Py_SIZE(product)); in k_lopsided_mul()
3558 sdigit left = a->ob_digit[0]; in fast_mod()
3559 sdigit right = b->ob_digit[0]; in fast_mod()
3581 sdigit left = a->ob_digit[0]; in fast_floor_div()
3582 sdigit right = b->ob_digit[0]; in fast_floor_div()
3824 a->ob_digit[MANT_DIG_DIGITS] >> MANT_DIG_BITS == 0); in long_true_divide()
3827 b->ob_digit[MANT_DIG_DIGITS] >> MANT_DIG_BITS == 0); in long_true_divide()
3830 da = a->ob_digit[--a_size]; in long_true_divide()
3832 da = da * PyLong_BASE + a->ob_digit[--a_size]; in long_true_divide()
3833 db = b->ob_digit[--b_size]; in long_true_divide()
3835 db = db * PyLong_BASE + b->ob_digit[--b_size]; in long_true_divide()
3849 diff = diff * PyLong_SHIFT + bit_length_digit(a->ob_digit[a_size - 1]) - in long_true_divide()
3850 bit_length_digit(b->ob_digit[b_size - 1]); in long_true_divide()
3879 x->ob_digit[i] = 0; in long_true_divide()
3880 rem = v_lshift(x->ob_digit + shift_digits, a->ob_digit, in long_true_divide()
3882 x->ob_digit[a_size + shift_digits] = rem; in long_true_divide()
3892 rem = v_rshift(x->ob_digit, a->ob_digit + shift_digits, in long_true_divide()
3898 if (a->ob_digit[--shift_digits]) in long_true_divide()
3907 digit rem = inplace_divrem1(x->ob_digit, x->ob_digit, x_size, in long_true_divide()
3908 b->ob_digit[0]); in long_true_divide()
3926 x_bits = (x_size-1)*PyLong_SHIFT+bit_length_digit(x->ob_digit[x_size-1]); in long_true_divide()
3934 low = x->ob_digit[0] | inexact; in long_true_divide()
3937 x->ob_digit[0] = low & ~(2U*mask-1U); in long_true_divide()
3940 dx = x->ob_digit[--x_size]; in long_true_divide()
3942 dx = dx * PyLong_BASE + x->ob_digit[--x_size]; in long_true_divide()
4165 if ((Py_SIZE(c) == 1) && (c->ob_digit[0] == 1)) { in long_pow()
4247 digit bi = b->ob_digit[i]; in long_pow()
4264 const digit bi = b->ob_digit[i]; in long_pow()
4408 z->ob_digit[i] = (a->ob_digit[j] >> remshift) & lomask; in long_rshift1()
4410 z->ob_digit[i] |= (a->ob_digit[j+1] << hishift) & himask; in long_rshift1()
4473 z->ob_digit[i] = 0; in long_lshift1()
4476 accum |= (twodigits)a->ob_digit[j] << remshift; in long_lshift1()
4477 z->ob_digit[i] = (digit)(accum & PyLong_MASK); in long_lshift1()
4481 z->ob_digit[newsize-1] = (digit)accum; in long_lshift1()
4564 v_complement(z->ob_digit, a->ob_digit, size_a); in long_bitwise()
4580 v_complement(z->ob_digit, b->ob_digit, size_b); in long_bitwise()
4630 z->ob_digit[i] = a->ob_digit[i] & b->ob_digit[i]; in long_bitwise()
4634 z->ob_digit[i] = a->ob_digit[i] | b->ob_digit[i]; in long_bitwise()
4638 z->ob_digit[i] = a->ob_digit[i] ^ b->ob_digit[i]; in long_bitwise()
4647 z->ob_digit[i] = a->ob_digit[i] ^ PyLong_MASK; in long_bitwise()
4649 memcpy(&z->ob_digit[i], &a->ob_digit[i], in long_bitwise()
4655 z->ob_digit[size_z] = PyLong_MASK; in long_bitwise()
4656 v_complement(z->ob_digit, z->ob_digit, size_z+1); in long_bitwise()
4741 nbits = bit_length_digit(a->ob_digit[size_a-1]); in _PyLong_GCD()
4758 x = (((twodigits)a->ob_digit[size_a-1] << (2*PyLong_SHIFT-nbits)) | in _PyLong_GCD()
4759 ((twodigits)a->ob_digit[size_a-2] << (PyLong_SHIFT-nbits)) | in _PyLong_GCD()
4760 (a->ob_digit[size_a-3] >> nbits)); in _PyLong_GCD()
4762 y = ((size_b >= size_a - 2 ? b->ob_digit[size_a-3] >> nbits : 0) | in _PyLong_GCD()
4763 (size_b >= size_a - 1 ? (twodigits)b->ob_digit[size_a-2] << (PyLong_SHIFT-nbits) : 0) | in _PyLong_GCD()
4764 (size_b >= size_a ? (twodigits)b->ob_digit[size_a-1] << (2*PyLong_SHIFT-nbits) : 0)); in _PyLong_GCD()
4829 a_end = a->ob_digit + size_a; in _PyLong_GCD()
4830 b_end = b->ob_digit + size_b; in _PyLong_GCD()
4833 a_digit = a->ob_digit; in _PyLong_GCD()
4834 b_digit = b->ob_digit; in _PyLong_GCD()
4835 c_digit = c->ob_digit; in _PyLong_GCD()
4836 d_digit = d->ob_digit; in _PyLong_GCD()
5003 newobj->ob_digit[i] = tmp->ob_digit[i]; in long_subtype_new()
5114 quo_is_odd = Py_SIZE(quo) != 0 && ((quo->ob_digit[0] & 1) != 0); in _PyLong_DivmodNear()
5241 res = offsetof(PyLongObject, ob_digit) + Py_ABS(Py_SIZE(self))*sizeof(digit); in int___sizeof___impl()
5272 msd = ((PyLongObject *)self)->ob_digit[ndigits-1]; in int_bit_length_impl()
5347 bit_count += popcount_digit(z->ob_digit[i]); in int_bit_count_impl()
5357 PyObject *x = PyLong_FromLong(popcount_digit(z->ob_digit[i])); in int_bit_count_impl()
5625 offsetof(PyLongObject, ob_digit), /* tp_basicsize */
5719 v->ob_digit[0] = (digit)abs(ival); in _PyLong_Init()