addOverflows method

bool addOverflows(
  1. int other
)

Checks if the addition of this and other causes an overflow.

Implementation

bool addOverflows(int other) => ((other > 0) && (this > max - other)) || ((other < 0) && (this < min - other));