Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1166638b
Commit
1166638b
authored
Sep 11, 2005
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add FAQ entry regarding non-expoential representation.
parent
a1d09e2d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
Doc/lib/libdecimal.tex
Doc/lib/libdecimal.tex
+11
-2
No files found.
Doc/lib/libdecimal.tex
View file @
1166638b
...
...
@@ -32,7 +32,7 @@ differences prevent reliable equality testing and differences can accumulate.
For this reason, decimal would be preferred in accounting applications which
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
significance. This is the customary presentation for monetary applications. For
multiplication, the ``schoolbook'' approach uses all the figures in the
...
...
@@ -1141,7 +1141,7 @@ Decimal("4.68")
\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
excess digits and need to be validated. What methods should be used?
...
...
@@ -1189,6 +1189,15 @@ representive:
\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
}
?
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