using Azimuth; namespace Konis.Testbed { /// /// Changes one end of a range, taking the other end along when it would be passed. /// public static class RangeEdit { /// /// Returns with its minimum moved to . A minimum above the /// maximum raises the maximum to it. /// public static Variation WithMinimum(Variation range, double minimum) { return new Variation(minimum, System.Math.Max(minimum, range.Maximum.Value)); } /// /// Returns with its maximum moved to . A maximum below the /// minimum lowers the minimum to it. /// public static Variation WithMaximum(Variation range, double maximum) { return new Variation(System.Math.Min(maximum, range.Minimum.Value), maximum); } } }