--- a/src/cx/array_list.h Tue Sep 17 23:11:17 2024 +0200 +++ b/src/cx/array_list.h Tue Sep 17 23:19:03 2024 +0200 @@ -300,6 +300,7 @@ * * In other words, this function returns the index of the largest element * in \p arr that is less or equal to \p elem with respect to \p cmp_func. + * When no such element exists, \p size is returned. * * If \p elem is contained in the array, this is identical to * #cx_array_binary_search(). @@ -312,7 +313,7 @@ * @param elem_size the size of one element * @param elem the element to find * @param cmp_func the compare function - * @return the index of the closest element in the array + * @return the index of the largest upper bound, or \p size */ size_t cx_array_binary_search_inf( void const *arr,