operator unary- method

Interval operator unary-()

Unary minus on intervals.

-[a, b] = [-b, -a]

Implementation

Interval operator -() {
  if (this.isEmpty()) {
    return Interval.empty();
  } else {
    return Interval(-max, -min);
  }
}