Skip to content

Commit d11d567

Browse files
committed
Improve variable name
1 parent 8b5e377 commit d11d567

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Lib/statistics.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,14 +335,15 @@ def _integer_sqrt_of_frac_rto(n: int, m: int) -> int:
335335
return a | (a*a*m != n)
336336

337337

338-
# For 53 bit precision floats, the _float_sqrt_of_frac() shift is 109.
339-
_sqrt_shift: int = 2 * sys.float_info.mant_dig + 3
338+
# For 53 bit precision floats, the bit width used in
339+
# _float_sqrt_of_frac() is 109.
340+
_sqrt_bit_width: int = 2 * sys.float_info.mant_dig + 3
340341

341342

342343
def _float_sqrt_of_frac(n: int, m: int) -> float:
343344
"""Square root of n/m as a float, correctly rounded."""
344345
# See principle and proof sketch at: https://bugs.python.org/msg407078
345-
q = (n.bit_length() - m.bit_length() - _sqrt_shift) // 2
346+
q = (n.bit_length() - m.bit_length() - _sqrt_bit_width) // 2
346347
if q >= 0:
347348
numerator = _integer_sqrt_of_frac_rto(n, m << 2 * q) << q
348349
denominator = 1

0 commit comments

Comments
 (0)