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
e94060fb
Kaydet (Commit)
e94060fb
authored
Tem 01, 2005
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
More info on rounding modes. Add sections for floating point notes.
üst
f7955af6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
libdecimal.tex
Doc/lib/libdecimal.tex
+12
-7
No files found.
Doc/lib/libdecimal.tex
Dosyayı görüntüle @
e94060fb
...
@@ -501,13 +501,15 @@ with the \class{Context} constructor.
...
@@ -501,13 +501,15 @@ with the \class{Context} constructor.
arithmetic operations in the context.
arithmetic operations in the context.
The
\var
{
rounding
}
option is one of:
The
\var
{
rounding
}
option is one of:
\constant
{
ROUND
_
CEILING
}
(towards
\constant
{
Infinity
}
),
\begin{itemize}
\constant
{
ROUND
_
DOWN
}
(towards zero),
\item
\constant
{
ROUND
_
CEILING
}
(towards
\constant
{
Infinity
}
),
\constant
{
ROUND
_
FLOOR
}
(towards
\constant
{
-Infinity
}
),
\item
\constant
{
ROUND
_
DOWN
}
(towards zero),
\constant
{
ROUND
_
HALF
_
DOWN
}
(towards zero),
\item
\constant
{
ROUND
_
FLOOR
}
(towards
\constant
{
-Infinity
}
),
\constant
{
ROUND
_
HALF
_
EVEN
}
,
\item
\constant
{
ROUND
_
HALF
_
DOWN
}
(to nearest with ties going towards zero),
\constant
{
ROUND
_
HALF
_
UP
}
(away from zero), or
\item
\constant
{
ROUND
_
HALF
_
EVEN
}
(to nearest with ties going to nearest even integer),
\constant
{
ROUND
_
UP
}
(away from zero).
\item
\constant
{
ROUND
_
HALF
_
UP
}
(to nearest with ties going away from zero), or
\item
\constant
{
ROUND
_
UP
}
(away from zero).
\end{itemize}
The
\var
{
traps
}
and
\var
{
flags
}
fields list any signals to be set.
The
\var
{
traps
}
and
\var
{
flags
}
fields list any signals to be set.
Generally, new contexts should only set traps and leave the flags clear.
Generally, new contexts should only set traps and leave the flags clear.
...
@@ -834,6 +836,8 @@ The following table summarizes the hierarchy of signals:
...
@@ -834,6 +836,8 @@ The following table summarizes the hierarchy of signals:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection
{
Floating Point Notes
\label
{
decimal-notes
}}
\subsection
{
Floating Point Notes
\label
{
decimal-notes
}}
\subsubsection
{
Mitigating round-off error with increased precision
}
The use of decimal floating point eliminates decimal representation error
The use of decimal floating point eliminates decimal representation error
(making it possible to represent
\constant
{
0.1
}
exactly); however, some
(making it possible to represent
\constant
{
0.1
}
exactly); however, some
operations can still incur round-off error when non-zero digits exceed the
operations can still incur round-off error when non-zero digits exceed the
...
@@ -881,6 +885,7 @@ Decimal("0.0060000")
...
@@ -881,6 +885,7 @@ Decimal("0.0060000")
Decimal("0.0060000")
Decimal("0.0060000")
\end{verbatim}
\end{verbatim}
\subsubsection
{
Special values
}
The number system for the
\module
{
decimal
}
module provides special
The number system for the
\module
{
decimal
}
module provides special
values including
\constant
{
NaN
}
,
\constant
{
sNaN
}
,
\constant
{
-Infinity
}
,
values including
\constant
{
NaN
}
,
\constant
{
sNaN
}
,
\constant
{
-Infinity
}
,
...
...
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