[OT] Lower and upper median of 4

Era Scarecrow via Digitalmars-d digitalmars-d at puremagic.com
Sat Nov 26 13:26:01 PST 2016


On Saturday, 26 November 2016 at 20:19:38 UTC, Timon Gehr wrote:
> The following code (which I found using a quick brute-force 
> search) uses at most 4 comparisons.

  Which is probably the way to go. I was considering doing 
something similar for small sorting and the like, letting it get 
an optimized sort of say 8 items or less, and saving the results 
for quick compiling later.


More information about the Digitalmars-d mailing list