MCPcopy Index your code
hub / github.com/python/cpython / _integer_sqrt_of_frac_rto

Function _integer_sqrt_of_frac_rto

Lib/statistics.py:1705–1709  ·  view source on GitHub ↗

Square root of n/m, rounded to the nearest integer using round-to-odd.

(n: int, m: int)

Source from the content-addressed store, hash-verified

1703
1704
1705def _integer_sqrt_of_frac_rto(n: int, m: int) -> int:
1706 """Square root of n/m, rounded to the nearest integer using round-to-odd."""
1707 # Reference: https://www.lri.fr/~melquion/doc/05-imacs17_1-expose.pdf
1708 a = math.isqrt(n // m)
1709 return a | (a*a*m != n)
1710
1711
1712# For 53 bit precision floats, the bit width used in

Callers 1

_float_sqrt_of_fracFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…