function binarySearch(high, compare) {
  let low = 0;
  while (low < high) {
    const mid = low + (high - low >> 1);
    const i = compare(mid);
    if (i === 0) {
      return mid;
    }
    if (i > 0) {
      low = mid + 1;
    } else {
      high = mid;
    }
  }
  return low;
}
export {
  binarySearch
};
//# sourceMappingURL=binary-search.js.map
