summaryrefslogtreecommitdiffstats
path: root/Modules/_decimal
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2012-09-30 13:51:39 (GMT)
committerChristian Heimes <christian@cheimes.de>2012-09-30 13:51:39 (GMT)
commit5c9a5895d4357ad33c42f6d996142ae3fb591ad9 (patch)
tree78a81a898fdb26a9c5119b437f3bf995b8afd15c /Modules/_decimal
parent72c9946718004a13c895cc54a2b82e9a50fd4ef3 (diff)
parent2cac28b37ef1dfdfc90481cad780c1555c713b04 (diff)
downloadcpython-5c9a5895d4357ad33c42f6d996142ae3fb591ad9.zip
cpython-5c9a5895d4357ad33c42f6d996142ae3fb591ad9.tar.gz
cpython-5c9a5895d4357ad33c42f6d996142ae3fb591ad9.tar.bz2
merge
Diffstat (limited to 'Modules/_decimal')
-rw-r--r--Modules/_decimal/tests/bench.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/_decimal/tests/bench.py b/Modules/_decimal/tests/bench.py
index 7ab6b44..7e4a210 100644
--- a/Modules/_decimal/tests/bench.py
+++ b/Modules/_decimal/tests/bench.py
@@ -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