| Parameter | Description |
|---|---|
| ptr | The array to search. |
| value | The value to locate. |
| length | The number of elements to search. Indexes greater than or equal to length won't be searched. |
int The zero-based index of the value to find in the sorted array. If it is not found, a negative number that is the bitwise complement of the index of the next element larger than item or, if there is no larger element, the bitwise complement of the length.
Finds a value in a sorted array by binary search.
If the array is not sorted, the value might not be found, even if it's present in the array.
| Parameter | Description |
|---|---|
| ptr | The array to search. |
| value | The value to locate. |
| length | The number of elements to search. Indexes greater than or equal to length won't be searched. |
| comp | The comparison function used to determine the relative order of the elements. |
int The zero-based index of the value to find in the sorted array. If it is not found, a negative number that is the bitwise complement of the index of the next element larger than item or, if there is no larger element, the bitwise complement of the length.
Finds a value in a sorted array by binary search using a custom comparison.
If the array is not sorted, the value might not be found, even if it's present in the array.
| Parameter | Description |
|---|---|
| container | The array to search. |
| value | The value to locate. |
int The zero-based index of the value to find in the sorted array. If it is not found, a negative number that is the bitwise complement of the index of the next element larger than item or, if there is no larger element, the bitwise complement of the length.
Finds a value in this sorted array by binary search.
If the array is not sorted, the value might not be found, even if it's present in this array.
| Parameter | Description |
|---|---|
| container | The array to search. |
| value | The value to locate. |
| comp | The comparison function used to determine the relative order of the elements. |
int The zero-based index of the value to find in the sorted array. If it is not found, a negative number that is the bitwise complement of the index of the next element larger than item or, if there is no larger element, the bitwise complement of the length.
Finds a value in this sorted array by binary search using a custom comparison.
If the array is not sorted, the value might not be found, even if it's present in this array.
| Parameter | Description |
|---|---|
| container | The list to search. |
| value | The value to locate. |
int The zero-based index of the value to find in the sorted list. If it is not found, a negative number that is the bitwise complement of the index of the next element larger than item or, if there is no larger element, the bitwise complement of the length.
Finds a value in this sorted list by binary search.
If this list is not sorted, the value might not be found, even if it's present in this list.
| Parameter | Description |
|---|---|
| container | The list to search. |
| value | The value to locate. |
| comp | The comparison function used to determine the relative order of the elements. |
int The zero-based index of the value to find in the sorted list. If it is not found, a negative number that is the bitwise complement of the index of the next element larger than item or, if there is no larger element, the bitwise complement of the length.
Finds a value in this sorted list by binary search using a custom comparison.
If this list is not sorted, the value may not be found, even if it's present in this list.
| Parameter | Description |
|---|---|
| container | The list to search. |
| value | The value to locate. |
int The zero-based index of the value to find in the sorted list. If it is not found, a negative number that is the bitwise complement of the index of the next element larger than item or, if there is no larger element, the bitwise complement of the length.
Finds a value in this sorted list by binary search.
If this list is not sorted, the value might not be found, even if it's present in this list.
| Parameter | Description |
|---|---|
| container | The list to search. |
| value | The value to locate. |
| comp | The comparison function used to determine the relative order of the elements. |
int The zero-based index of the value to find in the sorted list. If it is not found, a negative number that is the bitwise complement of the index of the next element larger than item or, if there is no larger element, the bitwise complement of the length.
Finds a value in this sorted list by binary search using a custom comparison.
If this list is not sorted, the value might not be found, even if it's present in this list.
| Parameter | Description |
|---|---|
| roSpan | The ReadOnlySpan to search. |
| value | The value to locate. |
int The zero-based index of the value to find in the sorted ReadOnlySpan. If it is not found, a negative number that is the bitwise complement of the index of the next element larger than item or, if there is no larger element, the bitwise complement of the length.
Finds a value in this sorted ReadOnlySpan by binary search.
If this ReadOnlySpan is not sorted, the value might not be found, even if it's present in this ReadOnlySpan.
| Parameter | Description |
|---|---|
| roSpan | The ReadOnlySpan to search. |
| value | The value to locate. |
| comp | The comparison function used to determine the relative order of the elements. |
int The zero-based index of the value to find in the sorted ReadOnlySpan. If it is not found, a negative number that is the bitwise complement of the index of the next element larger than item or, if there is no larger element, the bitwise complement of the length.
Finds a value in this sorted ReadOnlySpan by binary search using a custom comparison.
If this ReadOnlySpan is not sorted, the value might not be found, even if it's present in this ReadOnlySpan.
| Parameter | Description |
|---|---|
| container | The slice to search. |
| value | The value to locate. |
int The zero-based index of the value to find in the sorted slice. If it is not found, a negative number that is the bitwise complement of the index of the next element larger than item or, if there is no larger element, the bitwise complement of the length.
Finds a value in this sorted slice by binary search.
If this slice is not sorted, the value might not be found, even if it's present in this slice.
| Parameter | Description |
|---|---|
| container | The slice to search. |
| value | The value to locate. |
| comp | The comparison function used to determine the relative order of the elements. |
int The zero-based index of the value to find in the sorted slice. If it is not found, a negative number that is the bitwise complement of the index of the next element larger than item or, if there is no larger element, the bitwise complement of the length.
Finds a value in this sorted slice by binary search using a custom comparison.
If this slice is not sorted, the value might not be found, even if it's present in this slice.