Java Number Range Create range(int min, int max, int value)

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

Description

range

License

Open Source License

Declaration

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

Method Source Code

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

public class Main {
    public static int range(int min, int max, int value) {
        if (value < min) {
            value = min;//from ww  w . j a v  a2 s.  c o m
        }

        if (value > max) {
            value = max;
        }

        return value;
    }

    public static double range(double min, double max, double value) {
        if (value < min) {
            value = min;
        }

        if (value > max) {
            value = max;
        }

        return value;
    }
}

Related

  1. range(int i, int j)
  2. Range(int k, int from, int end)
  3. range(int low, int high)
  4. range(int min, int max)
  5. range(int min, int max)
  6. range(int n)
  7. range(int start, int end)
  8. range(int start, int end)
  9. range(int start, int end)