Skip to content

Commit 9a3f05e

Browse files
committed
Make it clear that the pi function is modified for benchmarking purposes.
1 parent 7d0d57f commit 9a3f05e

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Modules/_decimal/tests/bench.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@
1818
C = import_fresh_module('decimal', fresh=['_decimal'])
1919
P = import_fresh_module('decimal', blocked=['_decimal'])
2020

21-
22-
# Pi function from the decimal.py documentation
21+
#
22+
# NOTE: This is the pi function from the decimal documentation, modified
23+
# for benchmarking purposes. Since floats do not have a context, the higher
24+
# intermediate precision from the original is NOT used, so the modified
25+
# algorithm only gives an approximation to the correctly rounded result.
26+
# For serious use, refer to the documentation or the appropriate literature.
27+
#
2328
def pi_float():
2429
"""native float"""
2530
lasts, t, s, n, na, d, da = 0, 3.0, 3, 1, 0, 0, 24

0 commit comments

Comments
 (0)