Fix decimal write-up nits.

This commit is contained in:
Raymond Hettinger 2004-07-11 12:49:47 +00:00
parent 65df07bf23
commit 44dc13bf3e
1 changed files with 7 additions and 7 deletions

View File

@ -5066,7 +5066,7 @@ class is especially helpful for financial applications and other uses which
require exact decimal representation, control over precision, control over require exact decimal representation, control over precision, control over
rounding to meet legal or regulatory requirements, tracking of significant rounding to meet legal or regulatory requirements, tracking of significant
decimal places, or for applications where the user expects the results to 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 For example, calculating a 5\%{} tax on a 70 cent phone charge gives
different results in decimal floating point and binary floating point. different results in decimal floating point and binary floating point.
@ -5081,10 +5081,10 @@ Decimal("0.7350")
0.73499999999999999 0.73499999999999999
\end{verbatim} \end{verbatim}
Note that the \class{Decimal} result keeps a trailing zero, automatically The \class{Decimal} result keeps a trailing zero, automatically inferring four
inferring four place significance from two digit mulitiplicands. Decimal place significance from the two digit multiplicands. Decimal reproduces
reproduces mathematics as done by hand and avoids issues that can arise mathematics as done by hand and avoids issues that can arise when binary
when binary floating point cannot exactly represent decimal quantities. floating point cannot exactly represent decimal quantities.
Exact representation enables the \class{Decimal} class to perform Exact representation enables the \class{Decimal} class to perform
modulo calculations and equality tests that are unsuitable for binary modulo calculations and equality tests that are unsuitable for binary
@ -5102,8 +5102,8 @@ True
False False
\end{verbatim} \end{verbatim}
The \module{decimal} module also allows arbitrarily large precisions to be The \module{decimal} module provides arithmetic with as much precision as
set for calculation: needed:
\begin{verbatim} \begin{verbatim}
>>> getcontext().prec = 36 >>> getcontext().prec = 36