Square root of n/m, rounded to the nearest integer using round-to-odd.
(n: int, m: int)
| 1703 | |
| 1704 | |
| 1705 | def _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 |
no outgoing calls
no test coverage detected
searching dependent graphs…