Integer square roots avoid rounding a large count through a floating-point value. The result is the largest integer whose square fits.
Worked example
import math
print(math.isqrt(26))Result
5Implementation notes
The integer result is exact for the rounded-down root, not an approximation to a fractional answer. Square it and compare with the input when testing for a perfect square.
Try it yourself
Test a perfect square and the integers immediately beside it.
Open the Python example →Editorial date March 5, 2026 · Published December 6, 2026