Here you can find the source of between(double value, double value1, double value2)
Parameter | Description |
---|---|
value | the value to be checked |
value1 | the border of the interval |
value2 | the border of the interval. |
public static boolean between(double value, double value1, double value2)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w. j ava 2s .c o m * Returns true if and only if the given value is between value1 and value2. It doesn't matter * if value1 is bigger than value2 or vica-versa. * * @param value the value to be checked * @param value1 the border of the interval * @param value2 the border of the interval. * @return true if and only if the given value is between value1 and value2 */ public static boolean between(double value, double value1, double value2) { return (value1 <= value && value <= value2) || (value2 <= value && value <= value1); } }