Changed getSqrt() to use De Moivre method