@Test public void testBetween0And1() { Assertions.assertThat(MathExt.between(1.1, 0.0, 1.0)).isEqualTo(1.0); Assertions.assertThat(MathExt.between(1.0, 2.0, 10.0)).isEqualTo(2.0); Assertions.assertThat(MathExt.between(0.5, 0.0, 1.0)).isEqualTo(0.5); }
public static double between(double value, double min, double max) { Preconditions.checkArgument(min <= max, "min must be less than or equal to max"); return Math.max(Math.min(value, max), min); }
MathExt { public static double between(double value, double min, double max) { Preconditions.checkArgument(min <= max, "min must be less than or equal to max"); return Math.max(Math.min(value, max), min); } }
MathExt { public static double between(double value, double min, double max) { Preconditions.checkArgument(min <= max, "min must be less than or equal to max"); return Math.max(Math.min(value, max), min); }  }
MathExt { public static double between(double value, double min, double max) { Preconditions.checkArgument(min <= max, "min must be less than or equal to max"); return Math.max(Math.min(value, max), min); }  static double scale(double value, double min, double max); static double scale(double value, double min, double max, double minRangeValue, double maxRangeValue); static double between(double value, double min, double max); static long between(long value, long min, long max); }
MathExt { public static double between(double value, double min, double max) { Preconditions.checkArgument(min <= max, "min must be less than or equal to max"); return Math.max(Math.min(value, max), min); }  static double scale(double value, double min, double max); static double scale(double value, double min, double max, double minRangeValue, double maxRangeValue); static double between(double value, double min, double max); static long between(long value, long min, long max);  }