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
44dc13bf
Kaydet (Commit)
44dc13bf
authored
Tem 11, 2004
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix decimal write-up nits.
üst
65df07bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
tut.tex
Doc/tut/tut.tex
+7
-7
No files found.
Doc/tut/tut.tex
Dosyayı görüntüle @
44dc13bf
...
...
@@ -5066,7 +5066,7 @@ class is especially helpful for financial applications and other uses which
require exact decimal representation, control over precision, control over
rounding to meet legal or regulatory requirements, tracking of significant
decimal places, or for applications where the user expects the results to
calculations done by hand.
match
calculations done by hand.
For example, calculating a 5
\%
{}
tax on a 70 cent phone charge gives
different results in decimal floating point and binary floating point.
...
...
@@ -5081,10 +5081,10 @@ Decimal("0.7350")
0.73499999999999999
\end{verbatim}
Note that the
\class
{
Decimal
}
result keeps a trailing zero, automatically
inferring four place significance from two digit mulitiplicands. Decimal
reproduces mathematics as done by hand and avoids issues that can arise
when binary
floating point cannot exactly represent decimal quantities.
The
\class
{
Decimal
}
result keeps a trailing zero, automatically inferring four
place significance from the two digit multiplicands. Decimal reproduces
mathematics as done by hand and avoids issues that can arise when binary
floating point cannot exactly represent decimal quantities.
Exact representation enables the
\class
{
Decimal
}
class to perform
modulo calculations and equality tests that are unsuitable for binary
...
...
@@ -5102,8 +5102,8 @@ True
False
\end{verbatim}
The
\module
{
decimal
}
module
also allows arbitrarily large precisions to be
set for calculation
:
The
\module
{
decimal
}
module
provides arithmetic with as much precision as
needed
:
\begin{verbatim}
>>> getcontext().prec = 36
...
...
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