mirror of
https://github.com/python/cpython.git
synced 2025-08-21 17:25:34 +00:00
Lost one line on a decimal recipe.
This commit is contained in:
parent
b3833ddecd
commit
c921dacf78
1 changed files with 1 additions and 0 deletions
|
@ -1884,6 +1884,7 @@ suggest, so we trap :const:`Inexact` to signal a need for more precision:
|
||||||
ctx = Context(prec=60)
|
ctx = Context(prec=60)
|
||||||
result = ctx.divide(numerator, denominator)
|
result = ctx.divide(numerator, denominator)
|
||||||
while ctx.flags[Inexact]:
|
while ctx.flags[Inexact]:
|
||||||
|
ctx.flags[Inexact] = False
|
||||||
ctx.prec *= 2
|
ctx.prec *= 2
|
||||||
result = ctx.divide(numerator, denominator)
|
result = ctx.divide(numerator, denominator)
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue