Skip to main content
. 2024 Apr 5;26(4):316. doi: 10.3390/e26040316
Algorithm 1. Calculation of the integer square root of x by rolling back from s0.
Input: x,s0
Output: s // integer square root of x
Initialization: si←s0
D←si2−x
While  (D>0) Do
si←si−1
D←D−(si≪1)−1
End Do
s←si