On Thu, Jan 15, 2015 at 11:44 AM, Павел Кудан <coodan@mail.ru> wrote:
That's not what the defintion that boost uses, boost gives you the smallest single interval in which the value will be. You are sugesting a "multi-interval". Not completely true.
I just suggest that arithmetic function does not return not correct results. And throw exception in the case when single interval cannot be returned - in same manner with boost interval comparison operators (default behaviour) in similar intermediate situation. To let user know that result is incorrect and he may use 'native' interval boost class functions (divide_part1(), divide_part2() in this case) to get correct result, as operator is not applicable to such situation any more.
But it *can* return a single interval. Always. And that's the correct result given the definition being used: a single interval that encapsulated the value. You are looking for a different definition, one of many possible definitions. Comparison is different, you can't always return True or False when there is partial overlap of intervals. You can however have various comparison definitions that *do* result in always True or False, e.g. the comparison "guaranteed to be be *always* smaller".