List of utility methods to do Double Number Between
double | between(double a, double b, double alpha) between return (a + (b - a) * alpha);
|
boolean | between(double a, double b, double candidate) between double min = Math.min(a, b); double max = Math.max(a, b); return candidate >= min && candidate <= max; |
boolean | between(double a, double x, double b) between return a <= x && x <= b;
|
boolean | between(double value, double end1, double end2) between if (end1 <= end2) return end1 <= value && value <= end2; else return end1 >= value && value >= end2; |
boolean | between(double value, double min, double max) between if (min > max) { return value <= min && value >= max; } else { return value >= min && value <= max; |
double | between(double value, double min, double max) between if (min <= value && value <= max) return value; throw new IllegalArgumentException(value + " must be between " + min + " and " + max); |
boolean | between(double value, double value1, double value2) Returns true if and only if the given value is between value1 and value2. return (value1 <= value && value <= value2) || (value2 <= value && value <= value1);
|
boolean | between(double value1, double value2, double valueObj) between return ((valueObj >= value1 && valueObj <= value2) || (valueObj <= value1 && valueObj >= value2));
|
boolean | between(double valueToCompare, double leftBoundary, double rightBoundary, double epsilon) Checks if a value is between two parameters with respect to a little error (epsilon) if (valueToCompare == leftBoundary || valueToCompare == rightBoundary) return true; if (valueToCompare >= leftBoundary && valueToCompare <= rightBoundary) return true; if (valueToCompare + epsilon < leftBoundary) return false; if (valueToCompare > rightBoundary + epsilon) return false; ... |
boolean | between(final double zScore, final int firstIndex, final int secondIndex) Check if zScore is between is between zScorePercentiles[firstIndex] and zScorePercentiles[secondIndex]. return ((zScore > zScorePercentiles[firstIndex] && zScore <= zScorePercentiles[secondIndex])
|| (zScore < zScorePercentiles[firstIndex] && zScore >= zScorePercentiles[secondIndex]));
|