Square root any nonnegative number, then the principal square root of −"x" is The right side (as well as its negative) is indeed a square root of −"x", since For every non-zero complex number "z" there exist precisely two numbers "w" such that : the principal square root of "z" (defined below), and its negative. There are two complex numbers that square to a given arbitrary non-zero imaginary number formula_11 with real formula_12 where the two-digit pattern {3, 6} repeats over and over again in the partial denominators. Since , the above is also identical to the following generalized continued fractions: The
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