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
9a3f05e6
Commit
9a3f05e6
authored
Sep 30, 2012
by
Stefan Krah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it clear that the pi function is modified for benchmarking purposes.
parent
7d0d57f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
Modules/_decimal/tests/bench.py
Modules/_decimal/tests/bench.py
+7
-2
No files found.
Modules/_decimal/tests/bench.py
View file @
9a3f05e6
...
...
@@ -18,8 +18,13 @@ except ImportError:
C
=
import_fresh_module
(
'decimal'
,
fresh
=
[
'_decimal'
])
P
=
import_fresh_module
(
'decimal'
,
blocked
=
[
'_decimal'
])
# Pi function from the decimal.py documentation
#
# NOTE: This is the pi function from the decimal documentation, modified
# for benchmarking purposes. Since floats do not have a context, the higher
# intermediate precision from the original is NOT used, so the modified
# algorithm only gives an approximation to the correctly rounded result.
# For serious use, refer to the documentation or the appropriate literature.
#
def
pi_float
():
"""native float"""
lasts
,
t
,
s
,
n
,
na
,
d
,
da
=
0
,
3.0
,
3
,
1
,
0
,
0
,
24
...
...
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