Calculate root of a number without Math library