Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 41e0310

Browse files
author
Stefan Krah
committed
Fix Overflow exception in the bignum factorial benchmark that is due to
the recent change of the default value for context.Emax.
1 parent 8dbbae9 commit 41e0310

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Modules/_decimal/tests/bench.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ def factorial(n, m):
8484
print("# Factorial")
8585
print("# ======================================================================\n")
8686

87-
C.getcontext().prec = C.MAX_PREC
87+
c = C.getcontext()
88+
c.prec = C.MAX_PREC
89+
c.Emax = C.MAX_EMAX
90+
c.Emin = C.MIN_EMIN
8891

8992
for n in [100000, 1000000]:
9093

0 commit comments

Comments
 (0)