Binary search for square root