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
e0f1581b
Kaydet (Commit)
e0f1581b
authored
Tem 05, 2004
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
* Fixup docstrings
* Make capitals default part of DefaultContext
üst
71432f1d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
decimal.py
Lib/decimal.py
+6
-7
No files found.
Lib/decimal.py
Dosyayı görüntüle @
e0f1581b
...
...
@@ -134,7 +134,6 @@ __all__ = [
import
threading
import
copy
import
math
import
operator
#Exponent Range
...
...
@@ -2120,8 +2119,7 @@ class Context(object):
Emax - Maximum exponent
capitals - If 1, 1*10^1 is printed as 1E+1.
If 0, printed as 1e1
(Defaults to 1)
clamp - If 1, change exponents if too high (Default 0)
_clamp - If 1, change exponents if too high (Default 0)
"""
DefaultLock
=
threading
.
Lock
()
...
...
@@ -2130,7 +2128,7 @@ class Context(object):
trap_enablers
=
None
,
flags
=
None
,
_rounding_decision
=
None
,
Emin
=
None
,
Emax
=
None
,
capitals
=
1
,
_clamp
=
0
,
capitals
=
None
,
_clamp
=
0
,
_ignored_flags
=
[]):
if
flags
is
None
:
flags
=
dict
.
fromkeys
(
Signals
,
0
)
...
...
@@ -2208,7 +2206,7 @@ class Context(object):
return
int
(
self
.
Emin
-
self
.
prec
+
1
)
def
Etop
(
self
):
"""Returns maximum exponent (= Em
in
- prec + 1)"""
"""Returns maximum exponent (= Em
ax
- prec + 1)"""
return
int
(
self
.
Emax
-
self
.
prec
+
1
)
def
_set_rounding_decision
(
self
,
type
):
...
...
@@ -2430,7 +2428,7 @@ class Context(object):
return
a
.
__mul__
(
b
,
context
=
self
)
def
normalize
(
self
,
a
):
"""normalize reduces
its
operand to its simplest form.
"""normalize reduces
an
operand to its simplest form.
Essentially a plus operation with all trailing zeros removed from the
result.
...
...
@@ -2968,7 +2966,8 @@ DefaultContext = Context(
flags
=
None
,
_rounding_decision
=
ALWAYS_ROUND
,
Emax
=
DEFAULT_MAX_EXPONENT
,
Emin
=
DEFAULT_MIN_EXPONENT
Emin
=
DEFAULT_MIN_EXPONENT
,
capitals
=
1
)
# Pre-made alternate contexts offered by the specification
...
...
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