public double Range( double Value, double LowerBound, bool LowerEqual, double UpperBound, bool UpperEqual )
Public Function Range ( Value As Double, LowerBound As Double, LowerEqual As Boolean, UpperBound As Double, UpperEqual As Boolean ) As Double
public: virtual double Range( double Value, double LowerBound, bool LowerEqual, double UpperBound, bool UpperEqual ) sealed
|InvalidValueException||Thrown if the lower bound is greater than the upper bound.|
|InvalidValueException||Thrown if LowerEqual and UpperEqual are both false and the ranged value equals one of these values. This is impossible to handle as the algorithm will always violate one of the rules!|
RangedValue = Range(InputValue, 0.0, True, 24.0, False)
The input value will be returned in the range where 0.0 is an allowable value and 24.0 is not i.e. in the range 0..23.999999..
It is not permissible for both LowerEqual and UpperEqual to be false because it will not be possible to return a value that is exactly equal to either lower or upper bounds. An exception is thrown if this scenario is requested.