intersection method

Interval intersection(
  1. Interval other
)

Return the interval in common between this and o */

Implementation

Interval intersection(Interval other) {
  return Interval.of(max(a, other.a), min(b, other.b));
}