def binary_search_for_left_range(mz_values, left_range):
    """
    Return the index in the sorted array where the value is larger or equal than left_range
    :param mz_values:
    :param left_range:
    :return:
    """
    l = len(mz_values)
    if mz_values[l - 1] < left_range:
        raise ValueError("No value bigger than %s" % left_range)
    low = 0
    high = l - 1
    while low <= high:
        mid = low + int(((high - low) / 2))
        if mz_values[mid] >= left_range:
            high = mid - 1
        else:
            low = mid + 1
    return high + 1