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
f207ffbd
Kaydet (Commit)
f207ffbd
authored
Eyl 15, 2005
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Sync-up with minor changes to the head.
üst
b930fbd9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
decimal.py
Lib/decimal.py
+15
-14
No files found.
Lib/decimal.py
Dosyayı görüntüle @
f207ffbd
...
@@ -515,7 +515,7 @@ class Decimal(object):
...
@@ -515,7 +515,7 @@ class Decimal(object):
if
isinstance
(
value
,
(
list
,
tuple
)):
if
isinstance
(
value
,
(
list
,
tuple
)):
if
len
(
value
)
!=
3
:
if
len
(
value
)
!=
3
:
raise
ValueError
,
'Invalid arguments'
raise
ValueError
,
'Invalid arguments'
if
value
[
0
]
not
in
[
0
,
1
]
:
if
value
[
0
]
not
in
(
0
,
1
)
:
raise
ValueError
,
'Invalid sign'
raise
ValueError
,
'Invalid sign'
for
digit
in
value
[
1
]:
for
digit
in
value
[
1
]:
if
not
isinstance
(
digit
,
(
int
,
long
))
or
digit
<
0
:
if
not
isinstance
(
digit
,
(
int
,
long
))
or
digit
<
0
:
...
@@ -760,18 +760,19 @@ class Decimal(object):
...
@@ -760,18 +760,19 @@ class Decimal(object):
Captures all of the information in the underlying representation.
Captures all of the information in the underlying representation.
"""
"""
if
self
.
_isnan
():
if
self
.
_is_special
:
minus
=
'-'
*
self
.
_sign
if
self
.
_isnan
():
if
self
.
_int
==
(
0
,):
minus
=
'-'
*
self
.
_sign
info
=
''
if
self
.
_int
==
(
0
,):
else
:
info
=
''
info
=
''
.
join
(
map
(
str
,
self
.
_int
))
else
:
if
self
.
_isnan
()
==
2
:
info
=
''
.
join
(
map
(
str
,
self
.
_int
))
return
minus
+
'sNaN'
+
info
if
self
.
_isnan
()
==
2
:
return
minus
+
'NaN'
+
info
return
minus
+
'sNaN'
+
info
if
self
.
_isinfinity
():
return
minus
+
'NaN'
+
info
minus
=
'-'
*
self
.
_sign
if
self
.
_isinfinity
():
return
minus
+
'Infinity'
minus
=
'-'
*
self
.
_sign
return
minus
+
'Infinity'
if
context
is
None
:
if
context
is
None
:
context
=
getcontext
()
context
=
getcontext
()
...
@@ -1446,7 +1447,7 @@ class Decimal(object):
...
@@ -1446,7 +1447,7 @@ class Decimal(object):
return
float
(
str
(
self
))
return
float
(
str
(
self
))
def
__int__
(
self
):
def
__int__
(
self
):
"""Converts self to a int, truncating if necessary."""
"""Converts self to a
n
int, truncating if necessary."""
if
self
.
_is_special
:
if
self
.
_is_special
:
if
self
.
_isnan
():
if
self
.
_isnan
():
context
=
getcontext
()
context
=
getcontext
()
...
...
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