| 309 except that they return the index of the closest element if the searched element is not found. |
309 except that they return the index of the closest element if the searched element is not found. |
| 310 The former function returns the closest element that is less or equal (the greatest lower bound / infimum), |
310 The former function returns the closest element that is less or equal (the greatest lower bound / infimum), |
| 311 and the latter function returns the closest element that is larger or equal (the least upper bound / supremum) |
311 and the latter function returns the closest element that is larger or equal (the least upper bound / supremum) |
| 312 than the searched element. |
312 than the searched element. |
| 313 |
313 |
| |
314 When the found element appears more than once in the array, |
| |
315 the binary search and the infimum report the largest index |
| |
316 and the supremum reports the smallest index of the identical items, respectively. |
| |
317 |
| 314 > Note that all the above functions are only well-defined on arrays which are sorted with respect to the given compare function. |
318 > Note that all the above functions are only well-defined on arrays which are sorted with respect to the given compare function. |
| 315 > |
319 > |
| 316 > This can, for example, easily be achieved by calling the standard library's `qsort()` function. |
320 > This can, for example, easily be achieved by calling the standard library's `qsort()` function. |
| 317 >{style="note"} |
321 >{style="note"} |
| 318 |
322 |