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
99148e7e
Kaydet (Commit)
99148e7e
authored
Tem 14, 2004
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Factor out two unnecessary global variables.
üst
d15dc06d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
decimal.py
Lib/decimal.py
+4
-11
No files found.
Lib/decimal.py
Dosyayı görüntüle @
99148e7e
...
@@ -129,10 +129,6 @@ import threading
...
@@ -129,10 +129,6 @@ import threading
import
copy
import
copy
import
operator
import
operator
#Exponent Range
DEFAULT_MAX_EXPONENT
=
999999999
DEFAULT_MIN_EXPONENT
=
-
999999999
#Rounding
#Rounding
ROUND_DOWN
=
'ROUND_DOWN'
ROUND_DOWN
=
'ROUND_DOWN'
ROUND_HALF_UP
=
'ROUND_HALF_UP'
ROUND_HALF_UP
=
'ROUND_HALF_UP'
...
@@ -1699,7 +1695,7 @@ class Decimal(object):
...
@@ -1699,7 +1695,7 @@ class Decimal(object):
elength
=
len
(
str
(
abs
(
n
)))
elength
=
len
(
str
(
abs
(
n
)))
firstprec
=
context
.
prec
firstprec
=
context
.
prec
if
not
modulo
and
firstprec
+
elength
+
1
>
D
EFAULT_MAX_EXPONENT
:
if
not
modulo
and
firstprec
+
elength
+
1
>
D
efaultContext
.
Emax
:
return
context
.
_raise_error
(
Overflow
,
'Too much precision.'
,
sign
)
return
context
.
_raise_error
(
Overflow
,
'Too much precision.'
,
sign
)
mul
=
Decimal
(
self
)
mul
=
Decimal
(
self
)
...
@@ -1922,8 +1918,7 @@ class Decimal(object):
...
@@ -1922,8 +1918,7 @@ class Decimal(object):
#ans is now a linear approximation.
#ans is now a linear approximation.
Emax
,
Emin
=
context
.
Emax
,
context
.
Emin
Emax
,
Emin
=
context
.
Emax
,
context
.
Emin
context
.
Emax
,
context
.
Emin
=
DEFAULT_MAX_EXPONENT
,
DEFAULT_MIN_EXPONENT
context
.
Emax
,
context
.
Emin
=
DefaultContext
.
Emax
,
DefaultContext
.
Emin
half
=
Decimal
(
'0.5'
)
half
=
Decimal
(
'0.5'
)
...
@@ -2947,8 +2942,8 @@ DefaultContext = Context(
...
@@ -2947,8 +2942,8 @@ DefaultContext = Context(
traps
=
[
DivisionByZero
,
Overflow
,
InvalidOperation
],
traps
=
[
DivisionByZero
,
Overflow
,
InvalidOperation
],
flags
=
[],
flags
=
[],
_rounding_decision
=
ALWAYS_ROUND
,
_rounding_decision
=
ALWAYS_ROUND
,
Emax
=
DEFAULT_MAX_EXPONENT
,
Emax
=
999999999
,
Emin
=
DEFAULT_MIN_EXPONENT
,
Emin
=
-
999999999
,
capitals
=
1
capitals
=
1
)
)
...
@@ -2961,14 +2956,12 @@ BasicContext = Context(
...
@@ -2961,14 +2956,12 @@ BasicContext = Context(
prec
=
9
,
rounding
=
ROUND_HALF_UP
,
prec
=
9
,
rounding
=
ROUND_HALF_UP
,
traps
=
[
DivisionByZero
,
Overflow
,
InvalidOperation
,
Clamped
,
Underflow
],
traps
=
[
DivisionByZero
,
Overflow
,
InvalidOperation
,
Clamped
,
Underflow
],
flags
=
[],
flags
=
[],
_rounding_decision
=
ALWAYS_ROUND
,
)
)
ExtendedContext
=
Context
(
ExtendedContext
=
Context
(
prec
=
9
,
rounding
=
ROUND_HALF_EVEN
,
prec
=
9
,
rounding
=
ROUND_HALF_EVEN
,
traps
=
[],
traps
=
[],
flags
=
[],
flags
=
[],
_rounding_decision
=
ALWAYS_ROUND
,
)
)
...
...
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