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
e2d4dd19
Kaydet (Commit)
e2d4dd19
authored
Kas 24, 1997
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use fuzzy comparison from test_support to compare outcome of
pow(x,y,z) to pow(x,y)%z.
üst
275feea4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
test_pow.py
Lib/test/test_pow.py
+4
-1
No files found.
Lib/test/test_pow.py
Dosyayı görüntüle @
e2d4dd19
import
sys
import
test_support
def
powtest
(
type
):
if
(
type
!=
float
):
...
...
@@ -27,8 +28,10 @@ def powtest(type):
il
,
ih
=
-
20
,
20
jl
,
jh
=
-
5
,
5
kl
,
kh
=
-
10
,
10
compare
=
cmp
if
(
type
==
float
):
il
=
1
compare
=
test_support
.
fcmp
elif
(
type
==
int
):
jl
=
0
elif
(
type
==
long
):
...
...
@@ -37,7 +40,7 @@ def powtest(type):
for
j
in
range
(
jl
,
jh
+
1
):
for
k
in
range
(
kl
,
kh
+
1
):
if
(
k
!=
0
):
if
(
pow
(
type
(
i
),
j
,
k
)
!=
pow
(
type
(
i
),
j
)
%
type
(
k
)
):
if
compare
(
pow
(
type
(
i
),
j
,
k
),
pow
(
type
(
i
),
j
)
%
type
(
k
)
):
raise
ValueError
,
"pow("
+
str
(
i
)
+
","
+
str
(
j
)
+
\
","
+
str
(
k
)
+
") != pow("
+
str
(
i
)
+
","
+
\
str
(
j
)
+
")
%
"
+
str
(
k
)
...
...
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