Square Root

Need to calculate a square root but you don't have a calculator at hand? Here is an algorithm that allows you to do this.

The algorithm is quite easy if you can subtract two numbers and know how to multiply two numbers. It is quite similar to the long division algorithm.
First, you have to split the number in pairs of digits. If needed, catenate the number with zero's. Besides, set the result and the remainder for the calculation to zero.
Repeat the following steps as many times as you want, i.e. until you have a result that fits your needs. Take the current remainder and catenate the next two digits. Take the result so-far, and multiply it by 2. Catenate this number with the largest digit for which the catenation multiplied with the same digit is less than or equal to the current remainder. Catenate the found digit to the current result. Subtract the catenation from the remainder, giving a new remainder.

Example:

Numbering Systems


2004-12-04