

def find_sqrt_bin_search(n, error=0.001):
    lower = (((n < 1) and n) or 1)
    upper = (((n < 1) and 1) or n)
    mid = (lower + ((upper - lower) / 2.0))
    square = (error * mid)
    while (abs((square - n)) > error):
        if (square < n):
            lower = mid
        else:
            upper = mid
        mid = (lower + ((upper - lower) / 2.0))
        square = (mid * mid)
    return mid

dataset/ETHPy150Open bt3gl/Python-and-Algorithms-and-Data-Structures/src/searching_and_sorting/searching/find_sqrt_bin_search.py find_sqrt_bin_search/VarMisuse@65/70 `mid`->`error`