An algorithm is process or set of rules for doing something
If we are looking for square rots which are integers then an algorithm might look like this
Put the number whose root is sought into a variable - the dividend.
Put 2 into a variable - the divisor
Begin a loop
divide the dividend by the divisor
put the result into a variable - the quotient
if the quotient = the divisor then the quotient is the square root of the divident
else, add 1 to the divisor
next loop
Chat with our AI personalities
The square root of 64 is 8 and you can work it out using the square root algorithm.
Negative numbers do not have "real number" square roots.However, they will have two roots (when using imaginary numbers) as do other numbers, where a root including i(square root of -1) is positive or negative.
Concrete.
The two square roots of 18 are: 4.242641 and -4.242641
The two square roots are +70 and -70 .