Make interval arithmetic handle empty intervals gracefully
Right now if you have two intervals
b and one of them is empty, the operations
a + b and
a - b throw an
ArgumentOutOfRangeException.. Making these operations simply return an empty interval instead would simplify calling code and actually fits the semantics of intervals well ("The sum of
b is the interval of all values
x + y for
I therefor suggest we make these operation return empty intervals in said case. I already tried to check if the exceptions are handled anywhere, which does not seem to be the case.
Any reason not to do it?