What algorithm is used for square root?
Newton's method for square root
If we have to find the square root of a number n, the function would be f(x) = x² - N and we would have to find the root of the function, f(x). Now, the better approximation can be found using (1). This is how the algorithm for finding square root of a number comes.
How does the computer calculate square root?
There are several ways to calculate a square root on a computer, among them: Using logarithms and exponentials. sqrt(x) = exp(0.5*log(x)) Using successive approximation numerical methods.