Hello Nigel.
My idea was solely, to avoid picking the one that lead to the “wrong” result, over and over, due to some freak pattern in the input, that coincides with the halving. And the code as such, was just meant to illustrate what I meant, as I grasp that sometimes something like that is used, as an “insurance” against the worst case scenario. I really meant to median position, and not the median, as you describe it. The two terms are often used interchangeably though. Maybe I should look over my use of pivot, and pivotvalue, I seem to use pivot for both of those as well. I do reckognize the importance, to communicate such subjects in an unambigous way, and will take greater care for the future.
It’s been a busy day, I’ll post the next version of the median handler: find/quickselect by the afternoon.
By the way, now that a large part of the world that doesn’t write from left to right parttake in programming, wouldn’t it be better to name the the start and end of a range, consistently with “start” and “end” instead of “left” and “right”. This is no critique of you of course, I came to think of it the other day, and felt just that the general convention of using “left” and “right” to denote the start and end of a range, is a bit outdated by now.