Java Number Min Value minMax(int value, int min, int max)

Here you can find the source of minMax(int value, int min, int max)

Description

min Max

License

Apache License

Declaration

public static int minMax(int value, int min, int max) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static int minMax(int value, int min, int max) {
        return Math.max(min, Math.min(max, value));
    }/*from   w  ww.  ja  va  2s .c o m*/

    public static int max(int... values) {
        int max = Integer.MIN_VALUE;
        for (int value : values) {
            if (value > max) {
                max = value;
            }
        }
        return max;
    }

    public static int min(int... values) {
        int min = Integer.MAX_VALUE;
        for (int value : values) {
            if (value < min) {
                min = value;
            }
        }
        return min;
    }
}

Related

  1. minLog2(int input)
  2. minMax(double v, double min, double max)
  3. minMax(int i)
  4. minmax(int min, int max, int now)
  5. minMax(int val, int min, int max)
  6. minMax(long x, long y, boolean max)
  7. minMaxInt(Long i1, String s, boolean max)
  8. minMaxNormalize(double min, double max, double value)
  9. minNot0(double i1, double i2)