Closed AbhimanyuAryan closed 5 years ago
This is an integer square root algorithm. For a given integer x
, this function finds the largest integer y
such that y * y <= x
. Hence, y = floor(sqrt(x)).
Try adding some print statements to see the intermediate values of i
and y
, and try calling the function different values of x
.
If you have further questions, please make a post on Stack Overflow and the fine volunteers will answer you: https://stackoverflow.com/questions/ask
I saw you calculating sqrt of some number but I didn't get how you are calculating floor of that number in this code