intervallum icon indicating copy to clipboard operation
intervallum copied to clipboard

Avoid overflow in operations due to +1 or -1.

Open ptal opened this issue 10 years ago • 1 comments

For example in Difference:

let left = self.intersection(&Interval::min_lb(other.lower() - Bound::one()));

It can overflow if the lower bound is unsigned and equals 0, it is avoidable.

ptal avatar Apr 14 '15 09:04 ptal

Related to #4, this could be done via checked add or strict add when rust-lang/rust#118260 is resolved.

George-Ogden avatar Apr 04 '25 09:04 George-Ogden