diff options
author | Christian Heimes <christian@cheimes.de> | 2012-09-30 13:51:39 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2012-09-30 13:51:39 (GMT) |
commit | 5c9a5895d4357ad33c42f6d996142ae3fb591ad9 (patch) | |
tree | 78a81a898fdb26a9c5119b437f3bf995b8afd15c /Modules/_decimal | |
parent | 72c9946718004a13c895cc54a2b82e9a50fd4ef3 (diff) | |
parent | 2cac28b37ef1dfdfc90481cad780c1555c713b04 (diff) | |
download | cpython-5c9a5895d4357ad33c42f6d996142ae3fb591ad9.zip cpython-5c9a5895d4357ad33c42f6d996142ae3fb591ad9.tar.gz cpython-5c9a5895d4357ad33c42f6d996142ae3fb591ad9.tar.bz2 |
merge
Diffstat (limited to 'Modules/_decimal')
-rw-r--r-- | Modules/_decimal/tests/bench.py | 9 |
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 |