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
bf9f79b1
Kaydet (Commit)
bf9f79b1
authored
Haz 30, 2010
tarafından
Mark Dickinson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Tests for Python 3.1's treatment of negated imaginary literals.
üst
ce5b6c43
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
test_complex.py
Lib/test/test_complex.py
+19
-0
No files found.
Lib/test/test_complex.py
Dosyayı görüntüle @
bf9f79b1
...
@@ -407,6 +407,25 @@ class ComplexTest(unittest.TestCase):
...
@@ -407,6 +407,25 @@ class ComplexTest(unittest.TestCase):
self
.
assertEquals
(
atan2
(
z1
.
imag
,
-
1.
),
atan2
(
0.
,
-
1.
))
self
.
assertEquals
(
atan2
(
z1
.
imag
,
-
1.
),
atan2
(
0.
,
-
1.
))
self
.
assertEquals
(
atan2
(
z2
.
imag
,
-
1.
),
atan2
(
-
0.
,
-
1.
))
self
.
assertEquals
(
atan2
(
z2
.
imag
,
-
1.
),
atan2
(
-
0.
,
-
1.
))
@unittest.skipUnless
(
float
.
__getformat__
(
"double"
)
.
startswith
(
"IEEE"
),
"test requires IEEE 754 doubles"
)
def
test_negated_imaginary_literal
(
self
):
z0
=
-
0
j
z1
=
-
7
j
z2
=
-
1e1000
j
# This behaviour is actually incorrect: the real part of a negated
# imaginary literal should be -0.0, not 0.0. It's fixed in Python 3.2.
# However, the behaviour is already out in the wild in Python 2.x and
# Python <= 3.1.2, and it would be too disruptive to change it in a
# bugfix release, so we call it a 'feature' of Python 3.1, and test to
# ensure that the behaviour remains consistent across 3.1.x releases.
self
.
assertFloatsAreIdentical
(
z0
.
real
,
0.0
)
self
.
assertFloatsAreIdentical
(
z0
.
imag
,
-
0.0
)
self
.
assertFloatsAreIdentical
(
z1
.
real
,
0.0
)
self
.
assertFloatsAreIdentical
(
z1
.
imag
,
-
7.0
)
self
.
assertFloatsAreIdentical
(
z2
.
real
,
0.0
)
self
.
assertFloatsAreIdentical
(
z2
.
imag
,
-
INF
)
@unittest.skipUnless
(
float
.
__getformat__
(
"double"
)
.
startswith
(
"IEEE"
),
@unittest.skipUnless
(
float
.
__getformat__
(
"double"
)
.
startswith
(
"IEEE"
),
"test requires IEEE 754 doubles"
)
"test requires IEEE 754 doubles"
)
def
test_overflow
(
self
):
def
test_overflow
(
self
):
...
...
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