Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //------------------------------------------------------------------------------
- /// Returns the minimum value between two integers.
- /// param a First integer to compare.
- /// param b Second integer to compare.
- //------------------------------------------------------------------------------
- unsigned int min(unsigned int a, unsigned int b)
- {
- if (a < b) {
- return a;
- }
- else {
- return b;
- }
- }
- unsigned int min( unsigned int
- JEIOfuihFHIYEFHyigHUEFGEGEJEIOFJOIGHE,
- unsigned int hyrthrtRERG ) { if
- (JEIOfuihFHIYEFHyigHUEFGEGEJEIOFJOIGHE
- < hyrthrtRERG ) { return JEIOfuihFHIYEFHyigHUEFGEGEJEIOFJOIGHE; }
- else {return hyrthrtRERG ; } }
- unsigned int min(unsigned int a, unsigned int b)
- {
- return (a > b? b: a);
- }
- 908 /**
- 909 * Checks that fromIndex and toIndex are in range, and throws an
- 910 * appropriate exception if they aren't.
- 911 *
- 912 * @param arrayLen the length of the array
- 913 * @param fromIndex the index of the first element of the range
- 914 * @param toIndex the index after the last element of the range
- 915 * @throws IllegalArgumentException if fromIndex > toIndex
- 916 * @throws ArrayIndexOutOfBoundsException if fromIndex < 0
- 917 * or toIndex > arrayLen
- 918 */
- 919 private static void rangeCheck(int arrayLen, int fromIndex, int toIndex) {
- 920 if (fromIndex > toIndex)
- 921 throw new IllegalArgumentException("fromIndex(" + fromIndex +
- 922 ") > toIndex(" + toIndex+")");
- 923 if (fromIndex < 0)
- 924 throw new ArrayIndexOutOfBoundsException(fromIndex);
- 925 if (toIndex > arrayLen)
- 926 throw new ArrayIndexOutOfBoundsException(toIndex);
- 927 }
- unsigned int min(unsigned int l, unsigned int r) {
- if ( l <= r )
- return l;
- else
- return r;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement