Skip to content

Commit

Permalink
Return a Decimal zero when the numerator is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
rhettinger committed Nov 29, 2021
1 parent 3911581 commit a09e3c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def _decimal_sqrt_of_frac(n: int, m: int) -> Decimal:
# Method: Check the result, moving up or down a step if needed.
if n <= 0:
if not n:
return 0.0
return Decimal('0.0')
n, m = -n, -m

root = (Decimal(n) / Decimal(m)).sqrt()
Expand Down

0 comments on commit a09e3c4

Please sign in to comment.