binary search for sqrt