as i said, right now it's a plain binary search; without looking at code i suspect it will find the smallest index that has value >= needle. so if you have [50, 70, 90, 100, 100, 100, 100, 100, 100, 100], it will find 100 as element #3. what would you say an intuitive answer would be? #9 (last such element)? #6 (middle of first and last)?
wait, it's not actually last such element, it should be "last element of the same value"
Should be last element of the same value so in above it should show 100th percentile
Should be last element of the same value so in above it should show 100th percentile