Created
August 25, 2017 23:28
-
-
Save thejoshwolfe/6df79a3c5b3e7b30ae184ced0f7eb9c0 to your computer and use it in GitHub Desktop.
Revisions
-
thejoshwolfe created this gist
Aug 25, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ int median3(int a, int b, int c) { int index = ((a < b) << 0) | ((b < c) << 1) | ((c < a) << 2); switch (index) { case 0: unreachable(); case 1: return c; case 2: return a; case 3: return b; case 4: return b; case 5: return a; case 6: return c; case 7: unreachable(); } unreachable(); }