Java Number Range Check inRange(double value, double min, double max)

Here you can find the source of inRange(double value, double min, double max)

Description

in Range

License

Apache License

Declaration

public static boolean inRange(double value, double min, double max) 

Method Source Code

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

public class Main {
    public static boolean inRange(double value, double min, double max) {
        return toRange(value, min, max) == value;
    }//from   w  w w. j  a  v  a2  s  . c om

    public static boolean inRange(int value, int min, int max) {
        return toRange(value, min, max) == value;
    }

    public static double toRange(double value, double min, double max) {
        return Math.max(Math.min(max, value), min);
    }

    public static int toRange(int value, int min, int max) {
        return Math.max(Math.min(max, value), min);
    }
}

Related

  1. inRange(double lat, double lon)
  2. inRange(double query, double min, double max)
  3. inRange(double value, double lower, double upper)
  4. inRange(double value, double min, double max)
  5. inRange(double value, double target, double range)
  6. inRange(double x, double y, double z, double sx, double sy, double sz, double r)
  7. inRange(E element, E min, E max)
  8. inRange(final float testNum, final float min, final float max)