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
9ea83cff
Kaydet (Commit)
9ea83cff
authored
Agu 26, 2014
tarafından
Stefan Krah
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge 3.4.
üst
e863739e
298131a4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
decimal.py
Lib/decimal.py
+2
-0
test_decimal.py
Lib/test/test_decimal.py
+5
-0
io.c
Modules/_decimal/libmpdec/io.c
+7
-4
No files found.
Lib/decimal.py
Dosyayı görüntüle @
9ea83cff
...
...
@@ -3759,6 +3759,8 @@ class Decimal(object):
if
self
.
_is_special
:
sign
=
_format_sign
(
self
.
_sign
,
spec
)
body
=
str
(
self
.
copy_abs
())
if
spec
[
'type'
]
==
'
%
'
:
body
+=
'
%
'
return
_format_align
(
sign
,
body
,
spec
)
# a type of None defaults to 'g' or 'G', depending on context
...
...
Lib/test/test_decimal.py
Dosyayı görüntüle @
9ea83cff
...
...
@@ -1058,6 +1058,11 @@ class FormatTest(unittest.TestCase):
# issue 6850
(
'a=-7.0'
,
'0.12345'
,
'aaaa0.1'
),
# issue 22090
(
'<^+15.20
%
'
,
'inf'
,
'<<+Infinity
%
<<<'
),
(
'
\x07
>,
%
'
,
'sNaN1234567'
,
'sNaN1234567
%
'
),
(
'=10.10
%
'
,
'NaN123'
,
' NaN123
%
'
),
]
for
fmt
,
d
,
result
in
test_values
:
self
.
assertEqual
(
format
(
Decimal
(
d
),
fmt
),
result
)
...
...
Modules/_decimal/libmpdec/io.c
Dosyayı görüntüle @
9ea83cff
...
...
@@ -446,7 +446,7 @@ _mpd_to_string(char **result, const mpd_t *dec, int flags, mpd_ssize_t dplace)
if
(
mpd_isspecial
(
dec
))
{
mem
=
sizeof
"-Infinity"
;
mem
=
sizeof
"-Infinity
%
"
;
if
(
mpd_isnan
(
dec
)
&&
dec
->
len
>
0
)
{
/* diagnostic code */
mem
+=
dec
->
digits
;
...
...
@@ -609,10 +609,10 @@ _mpd_to_string(char **result, const mpd_t *dec, int flags, mpd_ssize_t dplace)
*
cp
++
=
(
flags
&
MPD_FMT_UPPER
)
?
'E'
:
'e'
;
cp
=
exp_to_string
(
cp
,
ldigits
-
dplace
);
}
}
if
(
flags
&
MPD_FMT_PERCENT
)
{
*
cp
++
=
'%'
;
}
if
(
flags
&
MPD_FMT_PERCENT
)
{
*
cp
++
=
'%'
;
}
assert
(
cp
<
decstring
+
mem
);
...
...
@@ -1260,6 +1260,9 @@ mpd_qformat_spec(const mpd_t *dec, const mpd_spec_t *spec,
stackspec
.
align
=
'>'
;
spec
=
&
stackspec
;
}
if
(
type
==
'%'
)
{
flags
|=
MPD_FMT_PERCENT
;
}
}
else
{
uint32_t
workstatus
=
0
;
...
...
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