Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
3b055b59
Kaydet (Commit)
3b055b59
authored
Tem 25, 2016
tarafından
Berker Peksag
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #27601: Merge from 3.5
üst
ced8d4c6
aa46bd46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
stdtypes.rst
Doc/library/stdtypes.rst
+11
-11
No files found.
Doc/library/stdtypes.rst
Dosyayı görüntüle @
3b055b59
...
...
@@ -692,16 +692,16 @@ number, :class:`float`, or :class:`complex`::
m, n = m // P, n // P
if n % P == 0:
hash_ = sys.hash_info.inf
hash_
value
= sys.hash_info.inf
else:
# Fermat's Little Theorem: pow(n, P-1, P) is 1, so
# pow(n, P-2, P) gives the inverse of n modulo P.
hash_ = (abs(m) % P) * pow(n, P - 2, P) % P
hash_
value
= (abs(m) % P) * pow(n, P - 2, P) % P
if m < 0:
hash_
= -hash_
if hash_ == -1:
hash_ = -2
return hash_
hash_
value = -hash_value
if hash_
value
== -1:
hash_
value
= -2
return hash_
value
def hash_float(x):
"""Compute the hash of a float x."""
...
...
@@ -716,13 +716,13 @@ number, :class:`float`, or :class:`complex`::
def hash_complex(z):
"""Compute the hash of a complex number z."""
hash_ = hash_float(z.real) + sys.hash_info.imag * hash_float(z.imag)
hash_
value
= hash_float(z.real) + sys.hash_info.imag * hash_float(z.imag)
# do a signed reduction modulo 2**sys.hash_info.width
M = 2**(sys.hash_info.width - 1)
hash_
= (hash_ & (M - 1)) - (hash
& M)
if hash_ == -1:
hash_
=
= -2
return hash_
hash_
value = (hash_value & (M - 1)) - (hash_value
& M)
if hash_
value
== -1:
hash_
value
= -2
return hash_
value
.. _typeiter:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment