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
00f2029c
Kaydet (Commit)
00f2029c
authored
Tem 26, 2007
tarafından
Nick Coghlan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add explicit test for a misbehaving math.floor
üst
c473149a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
test_math.py
Lib/test/test_math.py
+4
-0
test_pow.py
Lib/test/test_pow.py
+3
-6
No files found.
Lib/test/test_math.py
Dosyayı görüntüle @
00f2029c
...
@@ -92,6 +92,10 @@ class MathTests(unittest.TestCase):
...
@@ -92,6 +92,10 @@ class MathTests(unittest.TestCase):
self
.
ftest
(
'floor(-0.5)'
,
math
.
floor
(
-
0.5
),
-
1
)
self
.
ftest
(
'floor(-0.5)'
,
math
.
floor
(
-
0.5
),
-
1
)
self
.
ftest
(
'floor(-1.0)'
,
math
.
floor
(
-
1.0
),
-
1
)
self
.
ftest
(
'floor(-1.0)'
,
math
.
floor
(
-
1.0
),
-
1
)
self
.
ftest
(
'floor(-1.5)'
,
math
.
floor
(
-
1.5
),
-
2
)
self
.
ftest
(
'floor(-1.5)'
,
math
.
floor
(
-
1.5
),
-
2
)
# pow() relies on floor() to check for integers
# This fails on some platforms - so check it here
self
.
ftest
(
'floor(1.23e167)'
,
math
.
floor
(
1.23e167
),
1.23e167
)
self
.
ftest
(
'floor(-1.23e167)'
,
math
.
floor
(
-
1.23e167
),
-
1.23e167
)
def
testFmod
(
self
):
def
testFmod
(
self
):
self
.
assertRaises
(
TypeError
,
math
.
fmod
)
self
.
assertRaises
(
TypeError
,
math
.
fmod
)
...
...
Lib/test/test_pow.py
Dosyayı görüntüle @
00f2029c
...
@@ -106,12 +106,9 @@ class PowTest(unittest.TestCase):
...
@@ -106,12 +106,9 @@ class PowTest(unittest.TestCase):
# platform pow() was buggy, and Python didn't worm around it.
# platform pow() was buggy, and Python didn't worm around it.
eq
=
self
.
assertEquals
eq
=
self
.
assertEquals
a
=
-
1.0
a
=
-
1.0
# XXX Temporary diagnostic for failure on alpha Debian buildbot
# The next two tests can still fail if the platform floor()
from
sys
import
__stdout__
# function doesn't treat all large inputs as integers
from
math
import
floor
# test_math should also fail if that is happening
print
>>
__stdout__
,
"*** Number:
%
r"
%
1.23e167
print
>>
__stdout__
,
"*** Floor:
%
r"
%
floor
(
1.23e167
)
# XXX End diagnostic message
eq
(
pow
(
a
,
1.23e167
),
1.0
)
eq
(
pow
(
a
,
1.23e167
),
1.0
)
eq
(
pow
(
a
,
-
1.23e167
),
1.0
)
eq
(
pow
(
a
,
-
1.23e167
),
1.0
)
for
b
in
range
(
-
10
,
11
):
for
b
in
range
(
-
10
,
11
):
...
...
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