8000 Replace float() call with int/int division to be parallel with the ot… · python/cpython@95330ee · GitHub
[go: up one dir, main page]

Skip to content

Commit 95330ee

Browse files
committed
Replace float() call with int/int division to be parallel with the other code path.
1 parent a4354c7 commit 95330ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/statistics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def _sqrt_frac(n: int, m: int) -> float:
319319
# See algorithm sketch at: https://bugs.python.org/msg406911
320320
q: int = (n.bit_length() - m.bit_length() - _sqrt_shift) // 2
321321
if q >= 0:
322-
return float(_isqrt_frac_rto(n, m << 2 * q) << q)
322+
return (_isqrt_frac_rto(n, m << 2 * q) << q) / 1
323323
else:
324324
return _isqrt_frac_rto(n << -2 * q, m) / (1 << -q)
325325

0 commit comments

Comments
 (0)
0