Created
March 31, 2014 06:13
-
-
Save wuqian/9886280 to your computer and use it in GitHub Desktop.
clamp
This file contains 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 characters
private final static int clamp(int x, int low, int high) { | |
return (x < low) ? low : ((x > high) ? high : x); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment