Lines Matching refs:PyLongObject
50 static PyLongObject *
51 maybe_small_long(PyLongObject *v) in maybe_small_long()
57 return (PyLongObject *)get_small_int(ival); in maybe_small_long()
66 _PyLong_Negate(PyLongObject **x_p) in _PyLong_Negate()
68 PyLongObject *x; in _PyLong_Negate()
70 x = (PyLongObject *)*x_p; in _PyLong_Negate()
76 *x_p = (PyLongObject *)PyLong_FromLong(-MEDIUM_VALUE(x)); in _PyLong_Negate()
103 static PyLongObject *
104 long_normalize(PyLongObject *v) in long_normalize()
121 ((PY_SSIZE_T_MAX - offsetof(PyLongObject, ob_digit))/sizeof(digit))
123 PyLongObject *
126 PyLongObject *result; in _PyLong_New()
137 result = PyObject_Malloc(offsetof(PyLongObject, ob_digit) + in _PyLong_New()
148 _PyLong_Copy(PyLongObject *src) in _PyLong_Copy()
150 PyLongObject *result; in _PyLong_Copy()
178 PyLongObject *v; in PyLong_FromLong()
257 PyLongObject *v = _PyLong_New(ndigits); \
313 PyLongObject *v; in PyLong_FromDouble()
376 PyLongObject *v; in PyLong_AsLongAndOverflow()
390 v = (PyLongObject *)vv; in PyLong_AsLongAndOverflow()
393 v = (PyLongObject *)_PyNumber_Index(vv); in PyLong_AsLongAndOverflow()
488 PyLongObject *v; in PyLong_AsSsize_t()
502 v = (PyLongObject *)vv; in PyLong_AsSsize_t()
544 PyLongObject *v; in PyLong_AsUnsignedLong()
557 v = (PyLongObject *)vv; in PyLong_AsUnsignedLong()
588 PyLongObject *v; in PyLong_AsSize_t()
601 v = (PyLongObject *)vv; in PyLong_AsSize_t()
631 PyLongObject *v; in _PyLong_AsUnsignedLongMask()
640 v = (PyLongObject *)vv; in _PyLong_AsUnsignedLongMask()
661 PyLongObject *lo; in PyLong_AsUnsignedLongMask()
673 lo = (PyLongObject *)_PyNumber_Index(op); in PyLong_AsUnsignedLongMask()
685 PyLongObject *v = (PyLongObject *)vv; in _PyLong_Sign()
703 PyLongObject *v = (PyLongObject *)vv; in _PyLong_NumBits()
739 PyLongObject* v; /* result */ in _PyLong_FromByteArray()
842 _PyLong_AsByteArray(PyLongObject* v, in _PyLong_AsByteArray()
1033 PyLongObject *v; in PyLong_FromLongLong()
1080 PyLongObject *v; in PyLong_FromSsize_t()
1124 PyLongObject *v; in PyLong_AsLongLong()
1135 v = (PyLongObject *)vv; in PyLong_AsLongLong()
1138 v = (PyLongObject *)_PyNumber_Index(vv); in PyLong_AsLongLong()
1156 res = _PyLong_AsByteArray((PyLongObject *)v, (unsigned char *)&bytes, in PyLong_AsLongLong()
1176 PyLongObject *v; in PyLong_AsUnsignedLongLong()
1189 v = (PyLongObject*)vv; in PyLong_AsUnsignedLongLong()
1195 res = _PyLong_AsByteArray((PyLongObject *)vv, (unsigned char *)&bytes, in PyLong_AsUnsignedLongLong()
1211 PyLongObject *v; in _PyLong_AsUnsignedLongLongMask()
1220 v = (PyLongObject *)vv; in _PyLong_AsUnsignedLongLongMask()
1241 PyLongObject *lo; in PyLong_AsUnsignedLongLongMask()
1253 lo = (PyLongObject *)_PyNumber_Index(op); in PyLong_AsUnsignedLongLongMask()
1276 PyLongObject *v; in PyLong_AsLongLongAndOverflow()
1290 v = (PyLongObject *)vv; in PyLong_AsLongLongAndOverflow()
1293 v = (PyLongObject *)_PyNumber_Index(vv); in PyLong_AsLongLongAndOverflow()
1566 static PyLongObject *
1567 divrem1(PyLongObject *a, digit n, digit *prem) in divrem1()
1570 PyLongObject *z; in divrem1()
1591 PyLongObject *scratch, *a; in long_to_decimal_string_internal()
1599 a = (PyLongObject *)aa; in long_to_decimal_string_internal()
1794 PyLongObject *a = (PyLongObject *)aa; in long_format_binary()
2035 long_from_binary_base(const char **str, int base, PyLongObject **res) in long_from_binary_base()
2043 PyLongObject *z; in long_from_binary_base()
2134 PyLongObject *z = NULL; in PyLong_FromString()
2426 PyLongObject *tmp; in PyLong_FromString()
2552 static PyLongObject *x_divrem
2553 (PyLongObject *, PyLongObject *, PyLongObject **);
2559 long_divrem(PyLongObject *a, PyLongObject *b, in long_divrem()
2560 PyLongObject **pdiv, PyLongObject **prem) in long_divrem()
2563 PyLongObject *z; in long_divrem()
2574 *prem = (PyLongObject *)long_long((PyObject *)a); in long_divrem()
2580 *pdiv = (PyLongObject*)zero; in long_divrem()
2588 *prem = (PyLongObject *) PyLong_FromLong((long)rem); in long_divrem()
2625 static PyLongObject *
2626 x_divrem(PyLongObject *v1, PyLongObject *w1, PyLongObject **prem) in x_divrem()
2628 PyLongObject *v, *w, *a; in x_divrem()
2764 _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e) in _PyLong_Frexp()
2894 return (double)MEDIUM_VALUE((PyLongObject *)v); in PyLong_AsDouble()
2896 x = _PyLong_Frexp((PyLongObject *)v, &exponent); in PyLong_AsDouble()
2912 long_compare(PyLongObject *a, PyLongObject *b) in long_compare()
2937 result = long_compare((PyLongObject*)self, (PyLongObject*)other); in long_richcompare()
2942 long_hash(PyLongObject *v) in long_hash()
3001 static PyLongObject *
3002 x_add(PyLongObject *a, PyLongObject *b) in x_add()
3005 PyLongObject *z; in x_add()
3011 { PyLongObject *temp = a; a = b; b = temp; } in x_add()
3035 static PyLongObject *
3036 x_sub(PyLongObject *a, PyLongObject *b) in x_sub()
3039 PyLongObject *z; in x_sub()
3047 { PyLongObject *temp = a; a = b; b = temp; } in x_sub()
3058 return (PyLongObject *)PyLong_FromLong(0); in x_sub()
3061 { PyLongObject *temp = a; a = b; b = temp; } in x_sub()
3090 long_add(PyLongObject *a, PyLongObject *b) in long_add()
3092 PyLongObject *z; in long_add()
3124 long_sub(PyLongObject *a, PyLongObject *b) in long_sub()
3126 PyLongObject *z; in long_sub()
3157 static PyLongObject *
3158 x_mul(PyLongObject *a, PyLongObject *b) in x_mul()
3160 PyLongObject *z; in x_mul()
3249 kmul_split(PyLongObject *n, in kmul_split()
3251 PyLongObject **high, in kmul_split()
3252 PyLongObject **low) in kmul_split()
3254 PyLongObject *hi, *lo; in kmul_split()
3276 static PyLongObject *k_lopsided_mul(PyLongObject *a, PyLongObject *b);
3282 static PyLongObject *
3283 k_mul(PyLongObject *a, PyLongObject *b) in k_mul()
3287 PyLongObject *ah = NULL; in k_mul()
3288 PyLongObject *al = NULL; in k_mul()
3289 PyLongObject *bh = NULL; in k_mul()
3290 PyLongObject *bl = NULL; in k_mul()
3291 PyLongObject *ret = NULL; in k_mul()
3292 PyLongObject *t1, *t2, *t3; in k_mul()
3321 return (PyLongObject *)PyLong_FromLong(0); in k_mul()
3503 static PyLongObject *
3504 k_lopsided_mul(PyLongObject *a, PyLongObject *b) in k_lopsided_mul()
3509 PyLongObject *ret; in k_lopsided_mul()
3510 PyLongObject *bslice = NULL; in k_lopsided_mul()
3528 PyLongObject *product; in k_lopsided_mul()
3558 long_mul(PyLongObject *a, PyLongObject *b) in long_mul()
3560 PyLongObject *z; in long_mul()
3582 fast_mod(PyLongObject *a, PyLongObject *b) in fast_mod()
3605 fast_floor_div(PyLongObject *a, PyLongObject *b) in fast_floor_div()
3648 l_divmod(PyLongObject *v, PyLongObject *w, in l_divmod()
3649 PyLongObject **pdiv, PyLongObject **pmod) in l_divmod()
3651 PyLongObject *div, *mod; in l_divmod()
3657 div = (PyLongObject *)fast_floor_div(v, w); in l_divmod()
3663 mod = (PyLongObject *)fast_mod(v, w); in l_divmod()
3681 PyLongObject *temp; in l_divmod()
3682 temp = (PyLongObject *) long_add(mod, w); in l_divmod()
3689 temp = (PyLongObject *) long_sub(div, (PyLongObject *)_PyLong_GetOne()); in l_divmod()
3714 PyLongObject *div; in long_div()
3719 return fast_floor_div((PyLongObject*)a, (PyLongObject*)b); in long_div()
3722 if (l_divmod((PyLongObject*)a, (PyLongObject*)b, &div, NULL) < 0) in long_div()
3735 PyLongObject *a, *b, *x; in long_true_divide()
3742 a = (PyLongObject *)v; in long_true_divide()
3743 b = (PyLongObject *)w; in long_true_divide()
3940 PyLongObject *div, *rem; in long_true_divide()
3993 PyLongObject *mod; in long_mod()
3998 return fast_mod((PyLongObject*)a, (PyLongObject*)b); in long_mod()
4001 if (l_divmod((PyLongObject*)a, (PyLongObject*)b, NULL, &mod) < 0) in long_mod()
4009 PyLongObject *div, *mod; in long_divmod()
4014 if (l_divmod((PyLongObject*)a, (PyLongObject*)b, &div, &mod) < 0) { in long_divmod()
4050 static PyLongObject *
4051 long_invmod(PyLongObject *a, PyLongObject *n) in long_invmod()
4053 PyLongObject *b, *c; in long_invmod()
4058 b = (PyLongObject *)PyLong_FromLong(1L); in long_invmod()
4062 c = (PyLongObject *)PyLong_FromLong(0L); in long_invmod()
4072 PyLongObject *q, *r, *s, *t; in long_invmod()
4080 t = (PyLongObject *)long_mul(q, c); in long_invmod()
4085 s = (PyLongObject *)long_sub(b, t); in long_invmod()
4098 if (long_compare(a, (PyLongObject *)_PyLong_GetOne())) { in long_invmod()
4125 PyLongObject *a, *b, *c; /* a,b,c = v,w,x */ in long_pow()
4128 PyLongObject *z = NULL; /* accumulated result */ in long_pow()
4130 PyLongObject *temp = NULL; in long_pow()
4135 PyLongObject *table[32] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, in long_pow()
4140 a = (PyLongObject*)v; Py_INCREF(a); in long_pow()
4141 b = (PyLongObject*)w; Py_INCREF(b); in long_pow()
4143 c = (PyLongObject *)x; in long_pow()
4178 temp = (PyLongObject *)_PyLong_Copy(c); in long_pow()
4192 z = (PyLongObject *)PyLong_FromLong(0L); in long_pow()
4199 temp = (PyLongObject *)_PyLong_Copy(b); in long_pow()
4238 z = (PyLongObject *)PyLong_FromLong(1L); in long_pow()
4260 temp = (PyLongObject *)long_mul(X, Y); \ in long_pow()
4303 temp = (PyLongObject *)long_sub(z, c); in long_pow()
4328 long_invert(PyLongObject *v) in long_invert()
4331 PyLongObject *x; in long_invert()
4334 x = (PyLongObject *) long_add(v, (PyLongObject *)_PyLong_GetOne()); in long_invert()
4344 long_neg(PyLongObject *v) in long_neg()
4346 PyLongObject *z; in long_neg()
4349 z = (PyLongObject *)_PyLong_Copy(v); in long_neg()
4356 long_abs(PyLongObject *v) in long_abs()
4365 long_bool(PyLongObject *v) in long_bool()
4386 PyLongObject *wordshift_obj = divrem1((PyLongObject *)shiftby, PyLong_SHIFT, remshift); in divmod_shift()
4404 long_rshift1(PyLongObject *a, Py_ssize_t wordshift, digit remshift) in long_rshift1()
4406 PyLongObject *z = NULL; in long_rshift1()
4412 PyLongObject *a1, *a2; in long_rshift1()
4413 a1 = (PyLongObject *) long_invert(a); in long_rshift1()
4416 a2 = (PyLongObject *) long_rshift1(a1, wordshift, remshift); in long_rshift1()
4420 z = (PyLongObject *) long_invert(a2); in long_rshift1()
4460 return long_rshift1((PyLongObject *)a, wordshift, remshift); in long_rshift()
4476 return long_rshift1((PyLongObject *)a, wordshift, remshift); in _PyLong_Rshift()
4480 long_lshift1(PyLongObject *a, Py_ssize_t wordshift, digit remshift) in long_lshift1()
4483 PyLongObject *z = NULL; in long_lshift1()
4531 return long_lshift1((PyLongObject *)a, wordshift, remshift); in long_lshift()
4547 return long_lshift1((PyLongObject *)a, wordshift, remshift); in _PyLong_Lshift()
4570 long_bitwise(PyLongObject *a, in long_bitwise()
4572 PyLongObject *b) in long_bitwise()
4576 PyLongObject *z; in long_bitwise()
4695 c = long_bitwise((PyLongObject*)a, '&', (PyLongObject*)b); in long_and()
4704 c = long_bitwise((PyLongObject*)a, '^', (PyLongObject*)b); in long_xor()
4713 c = long_bitwise((PyLongObject*)a, '|', (PyLongObject*)b); in long_or()
4723 v = _PyLong_Copy((PyLongObject *)v); in long_long()
4730 PyLongObject *a, *b, *c = NULL, *d = NULL, *r; in _PyLong_GCD()
4737 a = (PyLongObject *)aarg; in _PyLong_GCD()
4738 b = (PyLongObject *)barg; in _PyLong_GCD()
4748 a = (PyLongObject *)long_abs(a); in _PyLong_GCD()
4751 b = (PyLongObject *)long_abs(b); in _PyLong_GCD()
4774 r = (PyLongObject *)_PyLong_Copy(a); in _PyLong_GCD()
5011 PyLongObject *tmp, *newobj; in long_subtype_new()
5015 tmp = (PyLongObject *)long_new_impl(&PyLong_Type, x, obase); in long_subtype_new()
5022 newobj = (PyLongObject *)type->tp_alloc(type, n); in long_subtype_new()
5044 return Py_BuildValue("(N)", _PyLong_Copy((PyLongObject *)self)); in int___getnewargs___impl()
5093 PyLongObject *quo = NULL, *rem = NULL; in _PyLong_DivmodNear()
5122 if (long_divrem((PyLongObject*)a, (PyLongObject*)b, &quo, &rem) < 0) in _PyLong_DivmodNear()
5132 temp = long_neg((PyLongObject*)twice_rem); in _PyLong_DivmodNear()
5138 cmp = long_compare((PyLongObject *)twice_rem, (PyLongObject *)b); in _PyLong_DivmodNear()
5145 temp = long_sub(quo, (PyLongObject *)one); in _PyLong_DivmodNear()
5147 temp = long_add(quo, (PyLongObject *)one); in _PyLong_DivmodNear()
5149 quo = (PyLongObject *)temp; in _PyLong_DivmodNear()
5154 temp = long_add(rem, (PyLongObject *)b); in _PyLong_DivmodNear()
5156 temp = long_sub(rem, (PyLongObject *)b); in _PyLong_DivmodNear()
5158 rem = (PyLongObject *)temp; in _PyLong_DivmodNear()
5223 temp = long_neg((PyLongObject*)ndigits); in int___round___impl()
5248 temp = long_sub((PyLongObject *)self, in int___round___impl()
5249 (PyLongObject *)PyTuple_GET_ITEM(result, 1)); in int___round___impl()
5268 res = offsetof(PyLongObject, ob_digit) + Py_ABS(Py_SIZE(self))*sizeof(digit); in int___sizeof___impl()
5287 PyLongObject *result, *x, *y; in int_bit_length_impl()
5299 msd = ((PyLongObject *)self)->ob_digit[ndigits-1]; in int_bit_length_impl()
5306 result = (PyLongObject *)PyLong_FromSsize_t(ndigits - 1); in int_bit_length_impl()
5309 x = (PyLongObject *)PyLong_FromLong(PyLong_SHIFT); in int_bit_length_impl()
5312 y = (PyLongObject *)long_mul(result, x); in int_bit_length_impl()
5319 x = (PyLongObject *)PyLong_FromLong((long)msd_bits); in int_bit_length_impl()
5322 y = (PyLongObject *)long_add(result, x); in int_bit_length_impl()
5365 PyLongObject *z = (PyLongObject *)self; in int_bit_count_impl()
5388 PyObject *y = long_add((PyLongObject *)result, (PyLongObject *)x); in int_bit_count_impl()
5483 if (_PyLong_AsByteArray((PyLongObject *)self, in int_to_bytes_impl()
5652 offsetof(PyLongObject, ob_digit), /* tp_basicsize */
5753 PyLongObject *v = _PyLong_New(1); in _PyLong_Init()