]> granicus.if.org Git - python/commitdiff
Make it clear that the pi function is modified for benchmarking purposes.
authorStefan Krah <skrah@bytereef.org>
Sun, 30 Sep 2012 07:24:41 +0000 (09:24 +0200)
committerStefan Krah <skrah@bytereef.org>
Sun, 30 Sep 2012 07:24:41 +0000 (09:24 +0200)
Modules/_decimal/tests/bench.py

index 7ab6b4464cec3eb844c579f7587500a1e4321a24..7e4a210cd5a83e29db0d950418ce926815c8745c 100644 (file)
@@ -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