Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions mpmath/libmp/libintmath.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import math
import sys
from bisect import bisect

from .backend import BACKEND, gmpy, sage, sage_utils, MPZ, MPZ_ONE, MPZ_ZERO
Expand Down Expand Up @@ -316,9 +317,12 @@ def sqrt_fixed(x, prec):
getattr(sage_utils, "isqrt", lambda n: MPZ(n).isqrt())
sqrtrem = lambda n: MPZ(n).sqrtrem()
else:
isqrt_small = isqrt_small_python
isqrt_fast = isqrt_fast_python
isqrt = isqrt_python
if sys.version_info >= (3, 12):
isqrt_small = isqrt_fast = isqrt = math.isqrt
else:
isqrt_small = isqrt_small_python
isqrt_fast = isqrt_fast_python
isqrt = isqrt_python
sqrtrem = sqrtrem_python


Expand Down