Square root of 3 billion digits. The fraction (…) for the square root of three can be used as an approximation. Despite having a denominator of only 56, it differs from the correct value by less than (approximately ). The rounded value of 1.732 is correct to within 0.01% of the actual value. Archimedes reported , accurate to (six decimal places) and (four decimal places), respectively. It can be expressed as the continued fraction , expanded on the right. It can also be expressed by generalized continued fractions such as which is evaluated at every second term. The following nested square expressions converge to
Integer square root the integer square root. If working in base 2, the choice of digit is simplified to that between 0 (the "small candidate") and 1 (the "large candidate"), and digit manipulations can be expressed in terms of binary shift operations. With codice_1 being multiplication, codice_2 being left shift, and codice_3 being logical right shift, a recursive algorithm to find the integer square root of any natural number is: Or, iteratively instead of recursively: Traditional pen-and-paper presentations of the digit-by-digit algorithm include various optimisations not present in the code above, in particular the trick of presubtracting the square of the previous digits