Lines Matching defs:mod
3168 x * 2**PyLong_SHIFT = y + z (mod _PyHASH_MODULUS).
3570 * we're effectively doing unsigned arithmetic mod
3805 sdigit mod;
3812 mod = left % right;
3816 mod = right - 1 - (left - 1) % right;
3819 return PyLong_FromLong(mod * (sdigit)Py_SIZE(b));
3846 The expression a mod b has the value a - b*floor(a/b).
3851 a b a rem b a mod b
3856 So, to get from rem to mod, we have to add b if a and b
3870 PyLongObject *div, *mod;
3882 mod = (PyLongObject *)fast_mod(v, w);
3883 if (mod == NULL) {
3887 *pmod = mod;
3896 if (long_divrem(v, w, &div, &mod) < 0)
3898 if ((Py_SIZE(mod) < 0 && Py_SIZE(w) > 0) ||
3899 (Py_SIZE(mod) > 0 && Py_SIZE(w) < 0)) {
3901 temp = (PyLongObject *) long_add(mod, w);
3902 Py_DECREF(mod);
3903 mod = temp;
3904 if (mod == NULL) {
3910 Py_DECREF(mod);
3923 *pmod = mod;
3925 Py_DECREF(mod);
3937 PyLongObject *mod;
3945 if (long_rem(v, w, &mod) < 0)
3947 if ((Py_SIZE(mod) < 0 && Py_SIZE(w) > 0) ||
3948 (Py_SIZE(mod) > 0 && Py_SIZE(w) < 0)) {
3950 temp = (PyLongObject *) long_add(mod, w);
3951 Py_DECREF(mod);
3952 mod = temp;
3953 if (mod == NULL)
3956 *pmod = mod;
4243 PyLongObject *mod;
4247 if (l_mod((PyLongObject*)a, (PyLongObject*)b, &mod) < 0)
4248 mod = NULL;
4249 return (PyObject *)mod;
4255 PyLongObject *div, *mod;
4260 if (l_divmod((PyLongObject*)a, (PyLongObject*)b, &div, &mod) < 0) {
4266 PyTuple_SET_ITEM(z, 1, (PyObject *) mod);
4270 Py_DECREF(mod);
4509 result = X*Y % c. If c is NULL, skip the mod. */