binarySearch static method
Implementation
static int binarySearch(List<double> values, double target, [int step = 1]) {
int low = 0;
int high = values.length ~/ step - 2;
if (high == 0) return step;
int current = high >> 1;
for (;;) {
if (values[(current + 1) * step] <= target) {
low = current + 1;
} else {
high = current;
}
if (low == high) return (low + 1) * step;
current = (low + high) >> 1;
}
}