Home
last modified time | relevance | path

Searched refs:_PyHASH_MODULUS (Results 1 – 8 of 8) sorted by relevance

/external/python/cpython3/Modules/_decimal/tests/
Dbignum.py12 _PyHASH_MODULUS = sys.hash_info.modulus variable
18 _PyHASH_10INV = pow(10, _PyHASH_MODULUS - 2, _PyHASH_MODULUS)
26 exp_hash = pow(10, exp, _PyHASH_MODULUS)
28 exp_hash = pow(_PyHASH_10INV, -exp, _PyHASH_MODULUS)
29 hash_ = coeff * exp_hash % _PyHASH_MODULUS
/external/python/cpython3/Lib/test/
Dtest_numeric_tower.py14 _PyHASH_MODULUS = sys.hash_info.modulus variable
119 self.assertEqual(hash(F(1, _PyHASH_MODULUS)), _PyHASH_INF)
120 self.assertEqual(hash(F(-1, 3*_PyHASH_MODULUS)), -_PyHASH_INF)
121 self.assertEqual(hash(F(7*_PyHASH_MODULUS, 1)), 0)
122 self.assertEqual(hash(F(-_PyHASH_MODULUS, 1)), 0)
/external/python/cpython3/Python/
Dpyhash.c111 x = ((x << 28) & _PyHASH_MODULUS) | x >> (_PyHASH_BITS - 28); in _Py_HashDouble()
117 if (x >= _PyHASH_MODULUS) in _Py_HashDouble()
118 x -= _PyHASH_MODULUS; in _Py_HashDouble()
123 x = ((x << e) & _PyHASH_MODULUS) | x >> (_PyHASH_BITS - e); in _Py_HashDouble()
Dsysmodule.c982 PyLong_FromSsize_t(_PyHASH_MODULUS)); in get_hash_info()
/external/python/cpython3/Lib/
Dfractions.py40 _PyHASH_MODULUS = sys.hash_info.modulus variable
559 dinv = pow(self._denominator, _PyHASH_MODULUS - 2, _PyHASH_MODULUS)
563 hash_ = abs(self._numerator) * dinv % _PyHASH_MODULUS
D_pydecimal.py958 exp_hash = pow(10, self._exp, _PyHASH_MODULUS)
960 exp_hash = pow(_PyHASH_10INV, -self._exp, _PyHASH_MODULUS)
961 hash_ = int(self._int) * exp_hash % _PyHASH_MODULUS
6401 _PyHASH_MODULUS = sys.hash_info.modulus variable
6407 _PyHASH_10INV = pow(10, _PyHASH_MODULUS - 2, _PyHASH_MODULUS)
/external/python/cpython3/Include/
Dpyhash.h28 #define _PyHASH_MODULUS (((size_t)1 << _PyHASH_BITS) - 1) macro
/external/python/cpython3/Objects/
Dlongobject.c2979 x = ((x << PyLong_SHIFT) & _PyHASH_MODULUS) | in long_hash()
2982 if (x >= _PyHASH_MODULUS) in long_hash()
2983 x -= _PyHASH_MODULUS; in long_hash()