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
7a7739d7
Kaydet (Commit)
7a7739d7
authored
Agu 28, 2009
tarafından
Mark Dickinson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #6794: Fix handling of NaNs in Decimal.compare_total and
Decimal.compare_total_mag.
üst
429677ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
decimal.py
Lib/decimal.py
+5
-2
extra.decTest
Lib/test/decimaltestdata/extra.decTest
+16
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/decimal.py
Dosyayı görüntüle @
7a7739d7
...
...
@@ -2736,12 +2736,15 @@ class Decimal(object):
other_nan
=
other
.
_isnan
()
if
self_nan
or
other_nan
:
if
self_nan
==
other_nan
:
if
self
.
_int
<
other
.
_int
:
# compare payloads as though they're integers
self_key
=
len
(
self
.
_int
),
self
.
_int
other_key
=
len
(
other
.
_int
),
other
.
_int
if
self_key
<
other_key
:
if
sign
:
return
_One
else
:
return
_NegativeOne
if
self
.
_int
>
other
.
_int
:
if
self
_key
>
other_key
:
if
sign
:
return
_NegativeOne
else
:
...
...
Lib/test/decimaltestdata/extra.decTest
Dosyayı görüntüle @
7a7739d7
...
...
@@ -154,6 +154,22 @@ extr1301 fma Inf 0 sNaN456 -> NaN Invalid_operation
extr1302 fma 0E123 -Inf sNaN789 -> NaN Invalid_operation
extr1302 fma -Inf 0E-456 sNaN148 -> NaN Invalid_operation
-- Issue #6794: when comparing NaNs using compare_total, payloads
-- should be compared as though positive integers; not
-- lexicographically as strings.
extr1400 comparetotal NaN123 NaN45 -> 1
extr1401 comparetotal sNaN123 sNaN45 -> 1
extr1402 comparetotal -NaN123 -NaN45 -> -1
extr1403 comparetotal -sNaN123 -sNaN45 -> -1
extr1404 comparetotal NaN45 NaN123 -> -1
extr1405 comparetotal sNaN45 sNaN123 -> -1
extr1406 comparetotal -NaN45 -NaN123 -> 1
extr1407 comparetotal -sNaN45 -sNaN123 -> 1
extr1410 comparetotal -sNaN63450748854172416 -sNaN911993 -> -1
extr1411 comparetotmag NaN1222222222222 -NaN999999 -> 1
-- max/min/max_mag/min_mag bug in 2.5.2/2.6/3.0: max(NaN, finite) gave
-- incorrect answers when the finite number required rounding; similarly
-- for the other thre functions
...
...
Misc/NEWS
Dosyayı görüntüle @
7a7739d7
...
...
@@ -359,6 +359,9 @@ Core and Builtins
Library
-------
- Issue #6794: Fix Decimal.compare_total and Decimal.compare_total_mag: NaN
payloads are now ordered by integer value rather than lexicographically.
- Issue #6693: New functions in site.py to get user/global site packages paths.
- The thread.lock type now supports weak references.
...
...
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