Java Number Min Value minmax(int min, int max, int now)

Here you can find the source of minmax(int min, int max, int now)

Description

minmax

License

Open Source License

Declaration

public static final int minmax(int min, int max, int now) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {

    public static final int minmax(int min, int max, int now) {
        if (now < min)
            return min;
        if (now > max)
            return max;
        return now;
    }/*from w w  w.ja v  a2 s.  c o m*/

    public static final float minmax(float min, float max, float now) {
        if (now < min)
            return min;
        if (now > max)
            return max;
        return now;
    }

    public static final double minmax(double min, double max, double now) {
        if (now < min)
            return min;
        if (now > max)
            return max;
        return now;
    }
}

Related

  1. minLimit(double d, double limit)
  2. minLimit(float value, float min)
  3. minLog2(int input)
  4. minMax(double v, double min, double max)
  5. minMax(int i)
  6. minMax(int val, int min, int max)
  7. minMax(int value, int min, int max)
  8. minMax(long x, long y, boolean max)
  9. minMaxInt(Long i1, String s, boolean max)