How to extract square root manually?