public int binarySearch(long value) {
int middle = 0;
int low = 0;
int pow = arr.length;
while(true) {
middle = (pow + low) / 2;
if(arr[middle] == value) {
return middle;
} else if(low > pow) {
return -1;
} else {
if(arr[middle] > value) {
pow = middle - 1;
} else {
low = middle + 1;
}
}
}
}