The math.isqrt()
computes the integer square root of a number.
The integer square root of a number is the greatest integer less than or equal to the exact square root of the number. For example, the exact square root of 20 is 4.47213595499958
, therefore, the integer square root of 20 is 4.
math.isqrt(x)
Where, parameter x
is an integer whose square root is to be calculated.
The argument given to math.isqrt()
function should be strictly integer. Otherwise, a TypeError
is raised.