binary search, sqrt