Here you can find the source of inRange(double value, double min, double max)
public static boolean inRange(double value, double min, double max)
//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); } }