Searched refs:_PyHASH_MODULUS (Results 1 – 8 of 8) sorted by relevance
/external/python/cpython3/Modules/_decimal/tests/ |
D | bignum.py | 12 _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/ |
D | test_numeric_tower.py | 14 _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/ |
D | pyhash.c | 111 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()
|
D | sysmodule.c | 982 PyLong_FromSsize_t(_PyHASH_MODULUS)); in get_hash_info()
|
/external/python/cpython3/Lib/ |
D | fractions.py | 40 _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.py | 958 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/ |
D | pyhash.h | 28 #define _PyHASH_MODULUS (((size_t)1 << _PyHASH_BITS) - 1) macro
|
/external/python/cpython3/Objects/ |
D | longobject.c | 2979 x = ((x << PyLong_SHIFT) & _PyHASH_MODULUS) | in long_hash() 2982 if (x >= _PyHASH_MODULUS) in long_hash() 2983 x -= _PyHASH_MODULUS; in long_hash()
|