dynamic operator +(Interval i)

Performs an interval addition.

[a, b] + [c, d] = [a + c, b + d]

Source

operator+(Interval i) {
  if (this.isEmpty() || i.isEmpty()) return new Interval.empty();
  return new Interval(this.min + i.min, this.max + i.max);
}