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
1166638b
Kaydet (Commit)
1166638b
authored
Eyl 11, 2005
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add FAQ entry regarding non-expoential representation.
üst
a1d09e2d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
libdecimal.tex
Doc/lib/libdecimal.tex
+11
-2
No files found.
Doc/lib/libdecimal.tex
Dosyayı görüntüle @
1166638b
...
@@ -32,7 +32,7 @@ differences prevent reliable equality testing and differences can accumulate.
...
@@ -32,7 +32,7 @@ differences prevent reliable equality testing and differences can accumulate.
For this reason, decimal would be preferred in accounting applications which
For this reason, decimal would be preferred in accounting applications which
have strict equality invariants.
have strict equality invariants.
\item
The decimal module incorporates notion of significant places so that
\item
The decimal module incorporates
a
notion of significant places so that
\samp
{
1.30 + 1.20
}
is
\constant
{
2.50
}
. The trailing zero is kept to indicate
\samp
{
1.30 + 1.20
}
is
\constant
{
2.50
}
. The trailing zero is kept to indicate
significance. This is the customary presentation for monetary applications. For
significance. This is the customary presentation for monetary applications. For
multiplication, the ``schoolbook'' approach uses all the figures in the
multiplication, the ``schoolbook'' approach uses all the figures in the
...
@@ -1141,7 +1141,7 @@ Decimal("4.68")
...
@@ -1141,7 +1141,7 @@ Decimal("4.68")
\end{verbatim}
\end{verbatim}
Q. In a fixed-point application
to
two decimal places, some inputs
Q. In a fixed-point application
with
two decimal places, some inputs
have many places and need to be rounded. Others are not supposed to have
have many places and need to be rounded. Others are not supposed to have
excess digits and need to be validated. What methods should be used?
excess digits and need to be validated. What methods should be used?
...
@@ -1189,6 +1189,15 @@ representive:
...
@@ -1189,6 +1189,15 @@ representive:
\end{verbatim}
\end{verbatim}
Q. Some decimal values always print with exponential notation. Is there
a way to get a non-exponential representation?
A. For some values, exponential notation is the only way to express
the number of significant places in the coefficient. For example,
expressing
\constant
{
5.0E+3
}
as
\constant
{
5000
}
keeps the value
constant but cannot show the original's two-place significance.
Q. Is there a way to convert a regular float to a
\class
{
Decimal
}
?
Q. Is there a way to convert a regular float to a
\class
{
Decimal
}
?
A. Yes, all binary floating point numbers can be exactly expressed as a
A. Yes, all binary floating point numbers can be exactly expressed as a
...
...
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