We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d11d567 commit 309cb0aCopy full SHA for 309cb0a
Lib/test/test_statistics.py
@@ -2237,7 +2237,9 @@ def test_decimal_sqrt_of_frac(self):
2237
# Confirm expected root with a quad precision decimal computation
2238
with decimal.localcontext(decimal.DefaultContext) as ctx:
2239
ctx.prec *= 4
2240
- high_prec_root = (Decimal(numerator) / Decimal(denominator)).sqrt()
+ high_prec_ratio = Decimal(numerator) / Decimal(denominator)
2241
+ ctx.rounding = decimal.ROUND_05UP
2242
+ high_prec_root = high_prec_ratio.sqrt()
2243
with decimal.localcontext(decimal.DefaultContext):
2244
target_root = +high_prec_root
2245
self.assertEqual(root, target_root)
0 commit comments