information:filtering, information:highlighting
Procedure for finding the leftmost element

To find the leftmost element, the following procedure can be used:

If L < n {\displaystyle L<n} and A L = T {\displaystyle A_{L}=T}, then A L {\displaystyle A_{L}} is the leftmost element that equals T {\displaystyle T}. Even if T {\displaystyle T} is not in the array, L {\displaystyle L} is the rank of T {\displaystyle T} in the array, or the number of elements in the array that are less than T {\displaystyle T}.

Where floor is the floor function, the pseudocode for this version is: