Skip to content

Instantly share code, notes, and snippets.

@hakusaro
Last active August 29, 2015 14:07
Show Gist options
  • Save hakusaro/2c69945b21783fb74807 to your computer and use it in GitHub Desktop.
Save hakusaro/2c69945b21783fb74807 to your computer and use it in GitHub Desktop.
This stupid bit of code finds the middle of 3 values.
if (first < second && third > second || third < second && first > second)
middle = second;
if (third < first && second > first || second < first && third > first)
middle = first;
if (second < third && first > third || first < third && second > third)
middle = third;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment