| 674 * |
674 * |
| 675 * In other words, this function returns the index of the largest element |
675 * In other words, this function returns the index of the largest element |
| 676 * in @p arr that is less or equal to @p elem with respect to @p cmp_func. |
676 * in @p arr that is less or equal to @p elem with respect to @p cmp_func. |
| 677 * When no such element exists, @p size is returned. |
677 * When no such element exists, @p size is returned. |
| 678 * |
678 * |
| |
679 * When such an element exists more than once, the largest index of all those |
| |
680 * elements is returned. |
| |
681 * |
| 679 * If @p elem is contained in the array, this is identical to |
682 * If @p elem is contained in the array, this is identical to |
| 680 * #cx_array_binary_search(). |
683 * #cx_array_binary_search(). |
| 681 * |
684 * |
| 682 * If the array is not sorted with respect to the @p cmp_func, the behavior |
685 * If the array is not sorted with respect to the @p cmp_func, the behavior |
| 683 * is undefined. |
686 * is undefined. |
| 695 CX_EXPORT size_t cx_array_binary_search_inf(const void *arr, size_t size, |
698 CX_EXPORT size_t cx_array_binary_search_inf(const void *arr, size_t size, |
| 696 size_t elem_size, const void *elem, cx_compare_func cmp_func); |
699 size_t elem_size, const void *elem, cx_compare_func cmp_func); |
| 697 |
700 |
| 698 /** |
701 /** |
| 699 * Searches an item in a sorted array. |
702 * Searches an item in a sorted array. |
| |
703 * |
| |
704 * When such an element exists more than once, the largest index of all those |
| |
705 * elements is returned. |
| 700 * |
706 * |
| 701 * If the array is not sorted with respect to the @p cmp_func, the behavior |
707 * If the array is not sorted with respect to the @p cmp_func, the behavior |
| 702 * is undefined. |
708 * is undefined. |
| 703 * |
709 * |
| 704 * @param arr the array to search |
710 * @param arr the array to search |
| 720 * |
726 * |
| 721 * In other words, this function returns the index of the smallest element |
727 * In other words, this function returns the index of the smallest element |
| 722 * in @p arr that is greater or equal to @p elem with respect to @p cmp_func. |
728 * in @p arr that is greater or equal to @p elem with respect to @p cmp_func. |
| 723 * When no such element exists, @p size is returned. |
729 * When no such element exists, @p size is returned. |
| 724 * |
730 * |
| |
731 * When such an element exists more than once, the smallest index of all those |
| |
732 * elements is returned. |
| |
733 * |
| 725 * If @p elem is contained in the array, this is identical to |
734 * If @p elem is contained in the array, this is identical to |
| 726 * #cx_array_binary_search(). |
735 * #cx_array_binary_search(). |
| 727 * |
736 * |
| 728 * If the array is not sorted with respect to the @p cmp_func, the behavior |
737 * If the array is not sorted with respect to the @p cmp_func, the behavior |
| 729 * is undefined. |
738 * is undefined. |